jenkins 配置git 出错:Host key verification failed.

报错内容和为:
Failed to connect to repository : Command "/usr/bin/git ls-remote -h git@git.XXXXX.com.cn:l-fe/myProgram.git HEAD" returned status code 128:
stdout:
stderr: No ECDSA host key is known for git.XXXXX.com.cn and you have requested strict checking.
Host key verification failed.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

但是jenkins服务器已经在本地配置过私钥还是有问题,后来查到原因是jenkins安装时使用的时jenkins用户,而服务器配置的是root用户,所以要解决问题,要么是服务器切换到jenkins用户配置ssh,要么是使用root用户,我这里机器有权限限制不可以切换到jenkins用户,所以我jenkins改为使用root用户,具体参考https://www.cnblogs.com/LiuYanYGZ/p/17987345

问题解决

posted @ 2024-06-26 09:58  洛晨随风  阅读(219)  评论(0编辑  收藏  举报