Jenkins主服务器无法通过SSH连接到从服务器 [英] Jenkins master fails to connect to the slave over SSH

查看:985
本文介绍了Jenkins主服务器无法通过SSH连接到从服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Jenkins主服务器在Amazon实例上运行,而从计算机则在专用的Soyoustart计算机上设置.正常工作直到需要重做从属设置:重新安装操作系统,安装Java,将主密钥添加到从属Authorized_keys并再次删除/添加了master_hosts主机中的从属.为从属服务器设置新的凭据,并在Jenkins主服务器中配置节点,但是该节点无法连接到从属服务器.

Jenkins master is running on Amazon instance and slave machine set up on dedicated Soyoustart machine. Worked fine until it was needed to redo the slave setup: reinstalled the OS, installed Java, added masters key to slave authorized_keys and removed/added again the slave in masters known_hosts. Set up new credentials for the slave and configured the node in Jenkins master but it is unable to connect to the slave.

设置与以前相同,并且一直与其他奴隶打working.唯一不同的是,这次新的从属服务器与旧的具有相同IP的计算机相同.

The setup is the the same that is and has been working with other slaves without hiccups. The only thing different is that this time the new slave is the same machine with the IP as the old one was.

可以通过CLI从主服务器ssh到从服务器(此帖子使用占位符替换了文件名和从IP): $ ssh -i <key-file> jenkins@<slave-ip>

It is possible to ssh into the slave from master from CLI(replaced filename and slave IP with placeholder for this post): $ ssh -i <key-file> jenkins@<slave-ip>

已设置凭据:

已配置节点:

连接到从站时的输出:

[05/17/15 07:30:31] [SSH] Opening SSH connection to <slave-ip>.
Key exchange was not finished, connection is closed.
ERROR: Unexpected error in launching a slave. This is probably a bug in Jenkins.
java.lang.IllegalStateException: Connection is not established!
at com.trilead.ssh2.Connection.getRemainingAuthMethods(Connection.java:1030)
at com.cloudbees.jenkins.plugins.sshcredentials.impl.TrileadSSHPublicKeyAuthenticator.getRemainingAuthMethods(TrileadSSHPublicKeyAuthenticator.java:88)
at com.cloudbees.jenkins.plugins.sshcredentials.impl.TrileadSSHPublicKeyAuthenticator.canAuthenticate(TrileadSSHPublicKeyAuthenticator.java:80)
at com.cloudbees.jenkins.plugins.sshcredentials.SSHAuthenticator.newInstance(SSHAuthenticator.java:207)
at com.cloudbees.jenkins.plugins.sshcredentials.SSHAuthenticator.newInstance(SSHAuthenticator.java:169)
at hudson.plugins.sshslaves.SSHLauncher.openConnection(SSHLauncher.java:1173)
at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:701)
at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:696)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
[05/17/15 07:30:31] Launch failed - cleaning up connection
[05/17/15 07:30:31] [SSH] Connection closed.

版本号:

  • 詹金斯1.613
  • SSH凭据插件1.11
  • SSH Slaves插件1.9

对于那些喜欢深入研究代码的人:

SSH从属插件

Trilead SSH

我在这里缺少明显的东西吗?是什么原因造成的?任何已知的解决方法?还是看起来像需要报告的错误?

Am I missing something obvious here? What could be causing this? Any known workaround? Or does it look like a bug that needs to be reported?

请让我知道是否需要更多信息.

Please let me know if more information is needed.

推荐答案

我正在使用官方Docker镜像运行Jenkins master,该镜像使用OpenJDK8,不需要安装JCE.

I'm running Jenkins master using official Docker image which uses OpenJDK8 and should not need to install JCE.

显然,这是Jenkins/SSH安全性中尚未解决的问题.

我当前的解决方法是注释掉 Jenkins Slave /etc/ssh/sshd_config中的MACsKexAlgorithm行,然后重新启动sshd(在Ubuntu上为service ssh restart)

My current workaround is by commenting out MACs and KexAlgorithm line in /etc/ssh/sshd_config of Jenkins Slave and restarting the sshd (service ssh restart on Ubuntu)

更新:此问题已于2017年4月29日解决

UPDATE: the issue has been resolved as of 2017-04-29

这篇关于Jenkins主服务器无法通过SSH连接到从服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆