Jenkins控制器无法通过SSH连接到代理

5ktev3wc  于 8个月前  发布在  Jenkins
关注(0)|答案(2)|浏览(80)

Jenkins控制器运行在Amazon示例上,代理机器设置在专用的Soyoustart机器上。工作正常,直到需要重做代理设置:重新安装操作系统,安装Java,将控制器密钥添加到代理的authorized_keys中,并在控制器的known_hosts中再次删除/添加代理。为代理设置新凭据并在Jenkins控制器中配置节点,但它无法连接到代理。
设置是相同的,并已与其他代理没有打嗝。唯一不同的是,这一次新的代理是同一台机器的IP作为旧的。
可以通过CLI从控制器机器ssh进入代理机器(在这篇文章中,将文件名和代理IP替换为占位符):$ ssh -i <key-file> jenkins@<agent-ip>

**凭证已设置:**x1c 0d1x
节点配置:

连接代理时的输出:

[05/17/15 07:30:31] [SSH] Opening SSH connection to <agent-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.

字符串

版本号:

我是不是漏掉了什么明显的东西?是什么原因导致了这个问题?有没有任何已知的解决方法?或者它看起来像是一个需要报告的bug?
请让我知道如果需要更多的信息。

p4tfgftt

p4tfgftt1#

我使用官方Docker镜像运行Jenkins master,它使用OpenJDK 8,不需要安装JCE。
Apparently this is an unresolved issue in Jenkins/SSH security.
我目前的解决方法是注解掉Jenkins Slave/etc/ssh/sshd_config中的MACsKexAlgorithm行,并重新启动sshd(Ubuntu上的service ssh restart

更新:截至2017-04-29问题已解决

nqwrtyyt

nqwrtyyt2#

我怀疑你需要为你的JVM安装Java加密扩展。如果没有这个,RSA密钥的大小是有限的,身份验证也不会被建立。
请参阅https://issues.jenkins-ci.org/browse/JENKINS-26495了解更多详细信息。

相关问题