我刚刚设置了我的第一个 Jenkins 奴隶。我运行构建,但遇到了 SSH 密钥问题。主 Jenkins 服务器在用户“jenkins”下运行。我已经设置了 SSH 密钥,这样我就可以在没有密码的情况下从主机 SSH 到从机。
例如来自主人:
jenkins@master:~$ ssh slave
Last login: Tue Apr 17 10:30:22 2012 from masterjenkins.com
$ whoami
jenkins
这样就证明从节点也在'jenkins'用户下运行。(我已将公共 ssh 密钥从 jenkins@slave 复制到远程 git 服务器)。而且我可以从从站手动发出 git clone,但是当我从主站开始构建时,我会收到以下消息:
ERROR: Error cloning remote repo 'origin' : Could not clone git@host:abc
hudson.plugins.git.GitException: Could not clone git@host:abc
Caused by: hudson.plugins.git.GitException: Error performing command: git clone --progress -o origin git@host:abc /var/lib/jenkins/workspace/abc_build
Command "git clone --progress -o origin git@host:abc /var/lib/jenkins/workspace/abc_build" returned status code 128: Initialized empty Git repository in /var/lib/jenkins/workspace/abc_build/.git/
Host key verification failed.
fatal: The remote end hung up unexpectedly
Caused by: hudson.plugins.git.GitException: Command "git clone --progress -o origin git@host:abc /var/lib/jenkins/workspace/abc_build" returned status code 128: Initialized empty Git repository in /var/lib/jenkins/workspace/abc_build/.git/
Host key verification failed.
fatal: The remote end hung up unexpectedly
Trying next repository
ERROR: Could not clone repository
FATAL: Could not clone
所以它仍然暗示我的 SSH 密钥设置不正确。谁能告诉我需要将哪些密钥复制到哪里?
非常感谢, ns