【问题标题】:gitolite and ssh-agent. Access denied.gitolite 和 ssh 代理。拒绝访问。
【发布时间】:2013-10-04 20:06:41
【问题描述】:

我在服务器 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 上为我提供完全相同的输出。

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

【问题讨论】:

  • 来自服务器 B 的“ssh git@A”作为user 是什么意思?它应该显示一个 gitolite 答案。
  • 好的,我知道发生了什么。我忘了删除我在 B 上的 /etc/hosts 中对 A 进行了一些测试的条目。
  • 好的,我已经添加了一个答案来说明这种情况。

标签: gitolite ssh-agent


【解决方案1】:

OP user2819697 提到的错误in the comments 以前见过:

我忘记删除我在/etc/hosts on B 上对A 进行了一些测试的条目。

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

如果 gitolite 和 jenkins 都托管在同一个 IP 上,接下来您需要在 /etc/hosts 中添加一个条目,用于 jenkins 服务器上的 git 存储库。

 hesco@pbx:/var/lib/jenkins$ sudo vim /etc/hosts
127.0.0.1       git.example.com git

因此,如果 B /etc/hosts 上的任何内容引用 A... 这将无法正常工作。

【讨论】:

    猜你喜欢
    • 2018-08-10
    • 1970-01-01
    • 2012-10-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-07-21
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多