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

版权声明:本文为博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/dreamstone_xiaoqw/article/details/79701834

原因: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目录。

至此,问题解决。

展开阅读全文

没有更多推荐了,返回首页