/root/.ssh/known_hosts [SSH] No Known Hosts file was found at /root/.ssh/known_hosts. Please ensure

这篇博客讲述了在配置Jenkins节点时遇到SSH连接失败的问题,错误信息显示Key交换未完成。解决方法包括在slave节点上生成SSH密钥对,并确保Jenkins有权限读取known_hosts文件。通过这些步骤可以解决Jenkins与远程节点的SSH连接问题。

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

Jenkins配置节点报错

在这里插入图片描述

SSHLauncher{host='192.168.111.129', port=22, credentialsId='aa9fc1b1-ccc2-470f-a612-f20e32b55dea', jvmOptions='', javaPath='', prefixStartSlaveCmd='', suffixStartSlaveCmd='', launchTimeoutSeconds=60, maxNumRetries=10, retryWaitTime=15, sshHostKeyVerificationStrategy=hudson.plugins.sshslaves.verifiers.KnownHostsFileKeyVerificationStrategy, tcpNoDelay=true, trackCredentials=true}
[01/05/22 17:08:28] [SSH] Opening SSH connection to 192.168.111.129:22.
/root/.ssh/known_hosts [SSH] No Known Hosts file was found at /root/.ssh/known_hosts. Please ensure one is created at this path and that Jenkins can read it.
Key exchange was not finished, connection is closed.
SSH Connection failed with IOException: "Key exchange was not finished, connection is closed.", retrying in 15 seconds. There are 10 more retries left.
/root/.ssh/known_hosts [SSH] No Known Hosts file was found at /root/.ssh/known_hosts. Please ensure one is created at this path and that Jenkins can read it.
Key exchange was not finished, connection is closed.
SSH Connection failed with IOException: "Key exchange was not finished, connection is closed.", retrying in 15 seconds. There are 9 more retries left.

解决办法:
注意:要用登录slave节点的用户操作

cd ~ # 回到家目录
ssh-keygen # 三次回车
ssh 192.168.111.129 # Slave节点机的ip地址
cd .ssh/
chmod 700 known_hosts
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值