我已经使用 gitosis 设置了一个 git 服务器,一切正常。出于安全原因,我决定改用公钥。我使用此命令在我的计算机上生成了我的 key 。
ssh-keygen -t rsa -C "email@address.com"
然后我将公钥添加到 keydir 并将该 key 包含在我的 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
请注意,我已经有了一把 key “home”,而且它工作正常。 “mac”键给我带来了问题。有谁知道如何解决这个问题?
最佳答案
使用 ssh -vvvv yourgitserver
连接以查看提供的 key 。您可以通过 ~/.ssh/config
文件控制给定哪个 key 并为您的服务器创建别名以向同一台机器提供不同的 key 。
希望这对您有所帮助。
顺便说一句,改用gitolite。它得到积极开发和维护; gitosis 不是。
关于linux - 使用公钥时 Git "ERROR:gitosis.serve.main:Repository read access denied",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6587614/