我刚刚设置了我的第一个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”用户下运行的 (我已经从jenkins@slave复制了公共ssh密钥到远程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