我从.ssh文件夹中删除了known_hosts文件,并且无法在BitBucket存储库中进行拖放操作 [英] I deleted the known_hosts file from .ssh folder and I can't pull or push in BitBucket repositories
问题描述
我犯了一个错误,并删除了.ssh文件夹中的known_hosts文件!现在,我无法在BitBucket存储库中进行抽取或推送。
I made a mistake and deleted the "known_hosts" file in ".ssh" folder! Now I can't pull or push in BitBucket repositories.
我该如何解决这个问题?
How can I solve it?
推荐答案
尝试执行:
Try executing:
ssh -T git@bitbucket.org
它会为您提供一些信息:
It would give you a message somethign like:
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
after verifying the host fingerprint (see details in the end).
然后你应该得到这个警告,你可以安全地忽略它:
Then you should get this warning, which you can ignore safely:
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
或 git push
再一次,它应该这次工作。
Try running the git pull
or git push
once again and it should work this time.
注意:我假设你还有 .ssh / id_rsa
安全文件,这是您的SSH身份验证的私钥。
NOTE: I assume you still have your .ssh/id_rsa
file safely which is your private key for SSH authentication.
正如@Pascal_dher指出的那样,如果您不验证主机的指纹(使用一些您可以依赖的带外方法),则可能成为中间人攻击的受害者。对于bitbucket,信息是在这里可用。
As @Pascal_dher pointed out, you can be a victim of man-in-the-middle attack if you do not verify the host's fingerprint (using some out of band approach that you can rely on). For bitbucket, the info is available here.
这篇关于我从.ssh文件夹中删除了known_hosts文件,并且无法在BitBucket存储库中进行拖放操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!