一、克隆远程仓库报错:
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 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 RSA key sent by the remote host is
SHA256:xnnnnnnnnnnnnnnnnnn.
Please contact your system administrator.
Add correct host key in /c/Users/cheng/.ssh/known_hosts to get rid of this message.
Offending RSA key in /c/Users/cheng/.ssh/known_hosts:6
RSA host key for [git.xxx.com]:80 has changed and you have requested strict checking.
Host key verification failed.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
二、问题原因
WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!
翻译过来就是
警告:远程主机标识已更改!
此报错是由于远程的主机的公钥发生了变化导致的。
ssh服务是通过公钥和私钥来进行连接的,它会把每个曾经访问过计算机或服务器的公钥(public key),记录在~/.ssh/known_hosts 中,当下次访问曾经访问过的计算机或服务器时,ssh就会核对公钥,如果和上次记录的不同,OpenSSH会发出警告。
三、解决方法
删除 .ssh/known_hosts中对应ip的信息:

在尝试克隆远程仓库时遇到REMOTE HOST IDENTIFICATION HAS CHANGED警告,该问题源于远程主机公钥变动。ssh服务通过公钥私钥认证,变更后的公钥导致OpenSSH警告。解决方案是删除.ssh/known_hosts中对应IP的信息。

7180

被折叠的 条评论
为什么被折叠?



