我在服务器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上给出了完全相同的输出。
有谁知道什么可以解释这个?
答案 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}},则此效果不佳。