您的位置:首页 > 教育 > 培训 > Jenkins 执行 shell 时报错 Host key verification failed.

Jenkins 执行 shell 时报错 Host key verification failed.

2024/10/6 1:39:06 来源:https://blog.csdn.net/wohu1104/article/details/142045874  浏览:    关键词:Jenkins 执行 shell 时报错 Host key verification failed.

1. 问题描述

jenkins 中执行下面的 shell 语句时

sshpass -p "123456" scp -r *  dep@192.168.1.100:/home/dep/Desktop/

报错

Host key verification failed.

可能原因是由于首次登录时需要输入 yes 导致无法连接成功。

The authenticity of host '192.168.1.100 (192.168.1.100)' can't be established.
ED25519 key fingerprint is SHA256:XjsUMxMz5XMwngdwR5VrKj7Dr2SciJvXDr6EtEMuwU0.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '192.168.1.100' (ED25519) to the list of known hosts.
dep@192.168.1.100's password: 

解决方案:

sudo su -s /bin/bash jenkins

再次执行上面的 scp 脚本,输入 yes 之后,后续再执行 shell 脚本应该就正常了。

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com