/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连接问题。

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
Permission denied, please try again. [10:38:32.370] > root@connect.yza1.seetacloud.com's password: [10:38:36.271] > [10:38:36.348] > Permission denied, please try again. [10:38:36.362] > root@connect.yza1.seetacloud.com's password: [10:38:38.942] > [10:38:39.067] > root@connect.yza1.seetacloud.com: Permission denied (publickey,password). [10:38:39.076] > 过程试图写入的管道不存在。 [10:38:40.370] "install" terminal command done [10:38:40.371] Install terminal quit with output: 过程试图写入的管道不存在。 [10:38:40.371] Received install output: 过程试图写入的管道不存在。 [10:38:40.371] WARN: $PLATFORM is undefined in installation script output. Errors may be dropped. [10:38:40.371] Failed to parse remote port from server output [10:38:40.372] Resolver error: Error at y.Create (c:\Users\asd\.vscode\extensions\ms-vscode-remote.remote-ssh-0.120.0\out\extension.js:2:744751) at t.handleInstallOutput (c:\Users\asd\.vscode\extensions\ms-vscode-remote.remote-ssh-0.120.0\out\extension.js:2:742832) at t.tryInstall (c:\Users\asd\.vscode\extensions\ms-vscode-remote.remote-ssh-0.120.0\out\extension.js:2:865534) at async c:\Users\asd\.vscode\extensions\ms-vscode-remote.remote-ssh-0.120.0\out\extension.js:2:824246 at async t.withShowDetailsEvent (c:\Users\asd\.vscode\extensions\ms-vscode-remote.remote-ssh-0.120.0\out\extension.js:2:827501) at async A (c:\Users\asd\.vscode\extensions\ms-vscode-remote.remote-ssh-0.120.0\out\extension.js:2:820760) at async t.resolve (c:\Users\asd\.vscode\extensions\ms-vscode-remote.remote-ssh-0.120.0\out\extension.js:2:824898) at async c:\Users\asd\.vscode\extensions\ms-vscode-remote.remote-ssh-0.120.0\out\extension.js:2:1113660 [10:38:40.376] ------ [10:38:40.377] No hints found in the recent session. [10:38:40.805] Opening exec server for ssh-remote+fcn [10:38:40.819] Initizing new exec server for ssh-remote+fcn [10:38:40.819] Using commit id "18e3a1ec544e6907be1e944a94c496e302073435" and quality "stable" for server [10:38:40.819] Extensions to install: [10:38:40.822] Install and start server if needed [10:40:09.321] getPlatformForHost was canceled [10:40:09.321] Exec server for ssh-remote+fcn failed: Error: 已取消连接 [10:40:09.322] Error opening exec server for ssh-remote+fcn: Error: 已取消连接 [10:40:09.322] No hints found in the recent session. [10:51:50.841] ConfigFileWatcher: start watching file:///c%3A/Users/asd/.ssh/config [10:51:50.841] ConfigFileWatcher: adding save listener [10:51:50.842] ConfigFileWatcher: adding close listener 如何解决,具体步骤
06-26
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值