Bash 由于git ssh密钥,从新服务器安装捆绑包时出错
我正在通过Bash 由于git ssh密钥,从新服务器安装捆绑包时出错,bash,git,jenkins,ssh,bundler,Bash,Git,Jenkins,Ssh,Bundler,我正在通过chef 并将ssh私钥和公钥放入其中 创建它之后,我通过jenkins将应用程序部署到它上面,并运行bundle install,由于 Host key verification failed. fatal: The remote end hung up unexpectedly 如果我使用ssh连接到服务器并自己运行bundle install命令,我会收到以下提示: The authenticity of host 'bitbucket.org (104.192.143.1)'
chef
并将ssh私钥和公钥放入其中
创建它之后,我通过jenkins
将应用程序部署到它上面,并运行bundle install
,由于
Host key verification failed.
fatal: The remote end hung up unexpectedly
如果我使用ssh连接到服务器并自己运行bundle install
命令,我会收到以下提示:
The authenticity of host 'bitbucket.org (104.192.143.1)' 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)?
github也是如此
The authenticity of host 'github.com (192.30.252.129)' can't be established.
RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
Are you sure you want to continue connecting (yes/no)? yes
我按“是”,包裹就完成了。最重要的是,如果我现在再次运行jenkins作业,包将成功完成
有什么想法,如何通过jenkins自动批准这些远程服务器的真实性吗?批准的信息保存在您的
~/.ssh/known_hosts
中,因此您可以将其与密钥一起复制,这样您就知道哪些密钥已获得批准
或者,您可以使用ssh keyscan
检索信息,并将结果附加到服务器的已知\u主机上,但请注意,如果您自动执行此操作,则会带来接受MITM机器的风险(因为您看不到已批准的内容)
最后,您可以禁用主机检查ssh-o StrictHostKeyChecking=no github.com
,但这对自动化ssh密钥扫描同样有害