2013-10-04 50 views
1

我有一個服務器A上的gitolite設置,我完全可以從我的本地機器克隆存儲庫。gitolite和ssh-agent。拒絕訪問。

[email protected]:$ git clone [email protected]:repo.git 

不過,我不能克隆到從服務器B

[email protected]:$ git clone [email protected]: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-添加-l同一個版本庫給了我完全本地機器和服務器B上的輸出相同。

有沒有人知道什麼可以解釋這一點?

+0

服務器'B'的'ssh git @ A'作爲'user'是什麼?它應該顯示一個gitolite答案。 – VonC

+0

好的,我知道發生了什麼事。我忘記刪除我使用的條目,在B上的/ etc/hosts中對A 進行了一些測試。 – user2819697

+0

好的,我添加了一個說明這種情況的答案。 – VonC

回答

0

OP user2819697提到in the comments錯誤已經見過:

我忘了刪除我用對A/etc/hostsB做了一些試驗項目。

你可以看到一個/ etc/hosts文件配置在這個setting for Jenkins and Gitolite

如果同一個IP主機都gitolite和詹金斯,你接下來要添加到/ etc/hosts中的條目的混帳存儲在jenkins服務器上。

[email protected]:/var/lib/jenkins$ sudo vim /etc/hosts 
127.0.0.1  git.example.com git 

所以,如果在B/etc/hosts什麼是指A ......這不能很好地工作。