Jenkins主机密钥验证失败
我的 有问题,设置为“ git”,显示以下错误:
Failed to connect to repository : Command "git ls-remote -h https://person@bitbucket.org/person/projectmarket.git HEAD" returned status code 128:stdout:
stderr: fatal: Authentication failed
我已经用 测试过:
git@bitbucket.org:person/projectmarket.git
这是错误的:
Failed to connect to repository : Command "git ls-remote -h git@bitbucket.org:person/projectmarket.git HEAD" returned status code 128:stdout:
stderr: Host key verification failed.
fatal: The remote end hung up unexpectedly
我还使用“ SSH密钥”完成了这些步骤。
在詹金斯下登录
sudo su jenkins
将您的github密钥复制到Jenkins .ssh文件夹
cp ~/.ssh/id_rsa_github* /var/lib/jenkins/.ssh/
重命名键
mv id_rsa_github id_rsamv id_rsa_github.pub id_rsa.pub
但仍然无法在 仓库。 *
感谢帮助!。
回答:
更改为jenkins
用户并手动运行命令:
git ls-remote -h git@bitbucket.org:person/projectmarket.git HEAD
首次通过SSH连接到新主机时,您将获得标准的SSH警告:
The authenticity of host 'bitbucket.org (207.223.240.181)' can't be established.RSA key fingerprint is 97:8c:1b:f2:6f:14:6b:5c:3b:ec:aa:46:46:74:7c:40.
Are you sure you want to continue connecting (yes/no)?
键入yes
,然后按Enter。bitbucket.org
现在,用于的主机密钥将添加到~/.ssh/known_hosts
文件中,您将不再在Jenkins中收到此错误。
以上是 Jenkins主机密钥验证失败 的全部内容, 来源链接: utcz.com/qa/415542.html