我犯了一个错误,删除了“.ssh”文件夹中的“known_hosts”文件!现在我无法在 BitBucket 存储库中拉取或推送。
我该如何解决?
尝试执行:
ssh -T [email protected] /cdn-cgi/l/email-protection
它会给你一条类似这样的消息:
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
Say yes
验证主机指纹后(详情见最后)。
然后您应该收到此警告,您可以安全地忽略该警告:
Warning: Permanently added 'bitbucket.org,207.223.240.181' (RSA) to the list of known hosts.
conq: logged in as tuxdude.
You can use git or hg to connect to Bitbucket. Shell access is disabled.
尝试运行git pull
or git push
再次,这次应该可以工作。
注意:我假设你仍然有你的.ssh/id_rsa
安全地保存文件,这是您用于 SSH 身份验证的私钥。
验证主机指纹
正如 @Pascal_dher 指出的那样,如果您不验证主机的指纹(使用一些您可以信赖的带外方法),您可能会成为中间人攻击的受害者。对于 bitbucket,信息是可以在这里找到 https://confluence.atlassian.com/bitbucket/use-the-ssh-protocol-with-bitbucket-cloud-221449711.html#UsetheSSHprotocolwithBitbucketCloud-KnownhostorBitbucket'spublickeyfingerprints.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)