解决Jenkins配置linux slave出现[SSH] Connection closed,问题

解决Jenkins配置linux slave出现[SSH] Connection closed.问题


DATE: 2018-03-26 18:15:19

原因:jenkins master 通过ssh登录slave失败

背景:已经安全ant,配置java环境OK

仔细看日志,发现错误信息:
/var/jenkins_home/.ssh/known_hosts [SSH] No Known Hosts file was found at /var/jenkins_home/.ssh/known_hosts. Please ensure one is created at this path and that Jenkins can read it.

Jenkins用户下,操作如下:

   64  ssh-keygen
   65  cd .ssh
   69  cat id_rsa.pub > authorized_keys
   70  chmod 700 authorized_keys

Jenkins master Web界面操作:

step 1

参考链接

"Known Hosts file verification strategy" 更改为 "Manually trusted key verification strategy".

CONFIGURE AGENT -> LAUNCH METHOD -> Manually trusted key verification strategy - > SAVE.

step 2

远程工作目录 ,配置为 /home/jenkins,此处配置为了让master能找到slave的.ssh目录。

至此,问题解决。

版权声明

弈心博客


本文首发site_name,转载请附上博文链接!