我在Ubuntu12.04上安装了Gitolite 3.5.3。我创建了测试回购,我可以通过ssh访问它,只与gitolite用户,而不是其他用户。我需要允许其他系统用户(user1、user、user2)或用户组通过ssh访问git(推、拉合并等),如下所示:
git clone user1@domain.com:megaproject但我试着像这样联系:
git clone user@domain.com:megaproject并为我得到的这个用户写正确的密码:
fatal: 'megaproject' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.即使我用ssh公钥在gitolite用户的主文件夹中创建keydir目录,也没有任何更改。
我应该改变什么来以这样的方式提供访问?
发布于 2013-11-22 07:25:57
你从不用“用户”克隆/访问由gitolite管理的回购。
您总是使用“git”帐户,您以前安装的是海泡石。
然后通过在~git/.ssh/authorized_keys file中查找用于此调用的公钥来推断您的真实身份。
更多见"How do programs like gitolite work?“。
如果您想以不同用户的身份访问gitolite管理的repo,则需要为这些用户拥有正确的公钥/私钥,并在~/..ssh/config文件中引用私钥,如"users are asked for password while using gitolite“所示。
Host gitolite_as_user1
HostName gitolite_server_name
User git
IdentityFile ~/.ssh/user1
Host gitolite_as_user2
HostName gitolite_server_name
User git
IdentityFile ~/.ssh/user2请注意,ssh url将是:
ssh://gitolite_as_user1:yourRepo
ssh://gitolite_as_user2:yourRepo而且它将始终使用'git‘帐户(但使用不同的公共ssh密钥)。
https://stackoverflow.com/questions/20139116
复制相似问题