简体   繁体   English

詹金斯上的主机密钥验证失败

[英]Host key verification failed on jenkins

Context: I am running a shell script on a remote machine through Jenkins. 上下文:我正在通过Jenkins在远程计算机上运行Shell脚本。 But while running I am getting "Host key verification failed." 但是在运行时,我得到“主机密钥验证失败”。 error on Jenkins log. Jenkins日志上的错误。

code snippet 程式码片段

#!/bin/sh
#Shell script for running the script from jenkin
#Performance Engineering Team
triggerPerformanceTest(){
echo "Starting the Jmeter script"
ssh -tt -i Test.ppk ubuntu@testserver << EOF
cd apache-jmeter-3.1/bin/
JVM_ARGS="-Xms512m -Xmx25000m" ./jmeter.sh -n -t /home/ubuntu/JMeter/Test.jmx
exit
EOF
echo "Test successfully executed"
}

triggerPerformanceTest

I can run the same query from my local machine through code editor(refer the screenshot attached). 我可以通过代码编辑器在本地计算机上运行相同的查询(请参阅随附的屏幕截图)。 在此处输入图片说明

Could some help me to resolve this issue? 可以帮我解决这个问题吗? Note: I cannot access to Jenkins server so not able to do anything there. 注意:我无法访问Jenkins服务器,因此无法在其中执行任何操作。

Your remote machine key is not known by Jenkins. Jenkins不知道您的远程机器密钥。 It's not present in ~/.ssh/known_hosts file. 它不在~/.ssh/known_hosts文件中。

This is a security to prevent man-in-the-middle attacks. 这是防止中间人攻击的安全措施。

Someone has to add it for you or you will not be able to ssh to the remote machine. 必须有人为您添加它,否则您将无法SSH到远程计算机。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM