我已经使用gitosis设置了一个git服务器,一切都很顺利。出于安全考虑,我决定转而使用公钥。我使用此命令在计算机上生成了我的密钥。
ssh-keygen -t rsa -C "email@address.com"
然后我将公钥添加到keydir并将密钥包含在我的gitosis.conf文件中。我提交了更改并将其上传到服务器。当我试图在我的git repo中提取更改时,它给了我这个错误。
错误
sfa-e1505-dn:VIIAD stefanbossbaly$ git pull
DEBUG:gitosis.serve.main:Got command "git-upload-pack 'git/VIIAD.git'"
DEBUG:gitosis.access.haveAccess:Access check for 'mac' as 'writable' on 'git/VIIAD.git'...
DEBUG:gitosis.access.haveAccess:Stripping .git suffix from 'git/VIIAD.git', new value 'git/VIIAD'
DEBUG:gitosis.group.getMembership:found 'mac' in 'app-dev'
DEBUG:gitosis.group.getMembership:found 'mac' in 'test'
DEBUG:gitosis.access.haveAccess:Access check for 'mac' as 'writeable' on 'git/VIIAD.git'...
DEBUG:gitosis.access.haveAccess:Stripping .git suffix from 'git/VIIAD.git', new value 'git/VIIAD'
DEBUG:gitosis.group.getMembership:found 'mac' in 'app-dev'
DEBUG:gitosis.group.getMembership:found 'mac' in 'test'
DEBUG:gitosis.access.haveAccess:Access check for 'mac' as 'readonly' on 'git/VIIAD.git'...
DEBUG:gitosis.access.haveAccess:Stripping .git suffix from 'git/VIIAD.git', new value 'git/VIIAD'
DEBUG:gitosis.group.getMembership:found 'mac' in 'app-dev'
DEBUG:gitosis.group.getMembership:found 'mac' in 'test'
ERROR:gitosis.serve.main:Repository read access denied
fatal: The remote end hung up unexpectedly
gitosis.conf的
[gitosis]
loglevel = DEBUG
[group app-dev]
writable = VIIAD android-backend
members = home mac
[group test]
writable = test
members = home mac
[group gitosis-admin]
members = home
writable = gitosis-admin mac
请注意,我已经有一个关键的“家”,它工作正常。 “mac”键给我带来了麻烦。有谁知道如何解决这个问题?
答案 0 :(得分:1)
使用ssh -vvvv yourgitserver
进行连接,了解要提供的密钥。您可以控制给出的密钥并为服务器创建别名,以通过~/.ssh/config
文件为同一台计算机提供不同的密钥。
希望这有帮助。
顺便说一句,请改用gitolite。它积极开发和维护; gitosis不是。