尝试克隆 git 存储库时出现“错误:gitosis.serve.main:存储库读取访问被拒绝”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6139324/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
"ERROR:gitosis.serve.main:Repository read access denied" when trying to clone a git repo
提问by Omid Kamangar
I have one desktop PC running Ubuntu 11.04 and one Netbook running Debian 6.0.1a. I have installed and configured git as described here, on my desktop PC.
我有一台运行 Ubuntu 11.04 的台式机和一台运行 Debian 6.0.1a 的上网本。我已经在我的台式 PC 上按照此处所述安装并配置了 git 。
I am also learning Symfony and have setup a repository for the Jobeet project on my PC. Now, when I try to clone the repository from Debian on my Netbook, I get this error:
我也在学习 Symfony 并在我的 PC 上为 Jobeet 项目设置了一个存储库。现在,当我尝试在上网本上从 Debian 克隆存储库时,出现以下错误:
ERROR:gitosis.serve.main:Repository read access denied
I have setup ssh and can easily connect to the Ubuntu from Debian with ssh.
我已经设置了 ssh,并且可以使用 ssh 从 Debian 轻松连接到 Ubuntu。
Contents of my gitosis.conf:
我的 gitosis.conf 的内容:
[gitosis]
[group symfony]
writable = jobeet
members = ako@ako-ubuntu-11 ako@debian
[group team]
writable = testproject
members = ako@ako-ubuntu-11 ako@debian
[group gitosis-admin]
members = ako@ako-ubuntu-11 ako@debian
writable = gitosis-admin
I have copied the id_rsa.pub file (public key of the Debian user) to the keydir directory too, and pushed back to the gitosis repo.
我也将 id_rsa.pub 文件(Debian 用户的公钥)复制到 keydir 目录,并推回到 gitosis 存储库。
I am able to clone the repository from Ubuntu machine, so I think it has something to do with the permissions and/or ssh.
我能够从 Ubuntu 机器克隆存储库,所以我认为它与权限和/或 ssh 有关。
Any help is greatly appreciated.
任何帮助是极大的赞赏。
采纳答案by Adam Dymitruk
First I would use gitolite instead. Gitosis is no longer actively developed.
首先,我会使用 gitolite 代替。Gitosis 不再积极开发。
Check that you need to name the public key to your user name that appears in the config. Your public key that you commit should be renamed to jobeet.pub.
检查您是否需要将公钥命名为出现在配置中的用户名。您提交的公钥应该重命名为 jobeet.pub。
Hope this helps.
希望这可以帮助。
回答by hrach
I got the same error while I was trying push new repository. It was caused by missing rights on /var/git/repositories/gitosis-admin.git/hooks/post-update
我在尝试推送新存储库时遇到了同样的错误。这是由于 /var/git/repositories/gitosis-admin.git/hooks/post-update 上缺少权限造成的
sudo chmod a+x /var/git/repositories/gitosis-admin.git/hooks/post-update