gitolite和ssh-agent。拒绝访问。

时间:2013-10-04 09:35:11

标签: gitolite ssh-agent

我在服务器A上设置了一个gitolite,我完全能够从本地计算机克隆存储库。

user@localmachine:$ git clone git@A:repo.git

尽管如此,我无法从服务器B克隆相同的存储库

user@B:$ git clone git@A:repo.git
Cloning into 'repo'...
R access for repo DENIED to user
(Or there may be no repository at the given path. Did you spell it correctly?)
fatal: The remote end hung up unexpectedly

我在〜/ .ssh / config中激活了ForwardAgent,ssh-add -l在本地计算机和服务器B上给出了完全相同的输出。

有谁知道什么可以解释这个?

1 个答案:

答案 0 :(得分:0)

之前看到OP user2819697提及in the comments的错误:

  

我忘记删除A /etc/hosts B hesco@pbx:/var/lib/jenkins$ sudo vim /etc/hosts 127.0.0.1 git.example.com git B进行了一些测试的条目。

您可以在此setting for Jenkins and Gitolite中看到/ etc / hosts配置:

  

如果同一个IP同时托管gitolite和jenkins,接下来你想在jenkins服务器上为git存储库的/ etc / hosts添加一个条目。

/etc/hosts

因此,如果A {{1}}上的任何内容引用{{1}},则此效果不佳。