您的位置:首页 > 其它

git clone报错WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!

2016-11-17 12:51 225 查看
在执行git clone时,报错,提示信息为:

$ git clone git@1xx.2xx.3xx.2xx:/xxx/sample.git
Cloning into 'sample'...
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the ECDSA key sent by the remote host is
x:1x:ex:6x:ax:cx:6x:6x:3x:3x:ex:3x:0x:cx:1x:5x.
Please contact your system administrator.
Add correct host key in /c/Users/xxx/.ssh/known_hosts to get rid of th
is message.
Offending RSA key in /c/Users/xxx/.ssh/known_hosts:10
ECDSA host key for 1xx.2xx.3xx.2xx has changed and you have requested strict chec
king.
Host key verification failed.
fatal: Could not read from remote repository.

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


问题原因:

服务端发生变化,加密的密钥改变,造成本地保存的密钥失败。

解决方案:

删除 ~/.ssh/known_hosts 文件中指定ip的密钥即可。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息