linux - 使用公钥时 Git "ERROR:gitosis.serve.main:Repository read access denied"

标签 linux security git gitosis public-key-encryption

我已经使用 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/

相关文章:

php - MySQL 数据库中加密数据的通配符搜索?

security - 是否值得对数据库中的电子邮件地址进行加密?

Git 子模块校验错误 : "fatal: reference is not a tree"

git - 我需要使用 Git 创建变更日志文件吗?

php - 运行脚本错误解释器 : Permission denied

linux - 我怎样才能创建一个假的设备文件来模仿 dev/mem?

.net - "The test form is only available for requests from the local machine."

git - 在本地 rebase 后更新 git pull 请求

java - 在谷歌计算引擎 Linux vm 上启动 tomcat

c++ - 我可以通过 c 或 c++ 中的另一个 UDS 连接传递 UDS 文件描述符吗