【发布时间】:2013-10-17 03:53:08
【问题描述】:
我有 2 台虚拟机(都是 Ubuntu 12),SRV-ATLASSIAN(安装了 Stash)和 SRV-CI(安装了 Jenkins)。
我想为 Jenkins 使用 Git 插件,所以我安装了它,在 SRV-ATLASSIAN 上创建了一个 SSH 密钥并将私钥 (id_rsa) 复制到 /var/lib/jenkins/.ssh
我 ssh-添加密钥
当我输入时
sudo su jenkins
cd /var/lib/jenkins/.ssh
git clone ssh://git@10.10.10.21:7999/test/test.git
在外壳上,它确实可以完美运行。
当我将此 URI 输入到 jenkins 的 GIT 插件中时,我收到以下错误消息:
Using strategy: Default
Fetching changes from 1 remote Git repository
Fetching upstream changes from origin
ERROR: Problem fetching from origin / origin - could be unavailable. Continuing anyway
hudson.plugins.git.GitException: Command "git fetch -t origin +refs/heads/*:refs/remotes/origin/*" returned status code 128:
stdout:
stderr: Permission denied (publickey).
fatal: The remote end hung up unexpectedly
我当然已经在谷歌上搜索过这个问题,但我不明白究竟该怎么做才能让它工作。奇怪的是,我可以从 shell 克隆为用户“詹金斯”,但詹金斯本身不能..
【问题讨论】: