Docker Jenkins 连接agent:SSH key presented by the remote host does not match the key saved in the Know

博客介绍了在物理机A的Docker上安装Jenkins后,配置连接物理机A作为agent时遇到的问题。在Jenkins中通过SSH配置agent时,出现SSH密钥不匹配、连接关闭等错误。后续将给出相应的解决办法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 

一、背景

 

物理机A 上安装了Docker, Docker 上有container Jenkins

Jenkins 要配置连接物理机A作为agent A(因为要在物理机A上执行一些Job)。

 

 

二、问题

在Jenkins->nodes下   配agent, 选的 launch slave agents via SSH

[07/10/19 09:35:19] [SSH] The SSH key presented by the remote host does not match the key saved in the Known Hosts file against this host. Connections to this host will be denied until the two keys match.
Key exchange was not finished, connection is closed.
java.io.IOException: There was a problem while connecting to  XXX:22
    at com.trilead.ssh2.Connection.connect(Connection.java:758)
    at hudson.plugins.sshslaves.SSHLauncher.openConnection(SSHLauncher.java:1324)
    at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:831)
    at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:820)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
Caused by: java.io.IOException: Key exchange was not finished, connection is closed.
    at com.trilead.ssh2.transport.KexManager.getOrWaitForConnectionInfo(KexManager.java:95)
    at com.trilead.ssh2.transport.TransportManager.getConnectionInfo(TransportManager.java:237)
    at com.trilead.ssh2.Connection.connect(Connection.java:710)
    ... 7 more
Caused by: java.io.IOException: The server hostkey was not accepted by the verifier callback
    at com.trilead.ssh2.transport.KexManager.handleMessage(KexManager.java:548)
    at com.trilead.ssh2.transport.TransportManager.receiveLoop(TransportManager.java:790)
    at com.trilead.ssh2.transport.TransportManager$1.run(TransportManager.java:502)
    ... 1 more

 

三、解决办法

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值