[英]Failed to connect to the host via ssh: Host key verification failed.\r\n
[英]ssh connection when building in Jenkins (Host key verification failed.)
在 Jenkins 中創建了一個項目,該項目應執行連接到 VM 的 bash 腳本:
ssh user@192.168.100.100 'ls'
執行時,我收到一個錯誤:
Host key verification failed.
同時,我將 ssh 密鑰添加到 Manage Credentials / Global credentials,指定密鑰、id 和用戶名
密鑰本身是在機器 192.168.100.100 上使用 ssh-keygen 生成的,並使用了 id_rsa
但我無法戰勝錯誤,告訴我在哪里看
如果您在控制台中運行相同的命令,我會在輸入密碼后得到響應
嘗試改用SSH Step 插件。 這將使您更好地控制連接。 語法如下所示。
def remote = [:]
remote.name = 'test'
remote.host = 'test.domain.com'
remote.user = 'root'
remote.password = 'password'
remote.allowAnyHosts = true
stage('Remote SSH') {
sshCommand remote: remote, command: "ls -lrt"
sshCommand remote: remote, command: "for i in {1..5}; do echo -n \"Loop \$i \"; date ; sleep 1; done"
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.