当vps或者服务器重装系统后其对应的key已经变化,而mac终端仍旧保存旧系统的key,所以导致发生此错误,解决办法如下:
If you get the following message when you connecting to a server through SSH, most likely the server side has changed authorization key.
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 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 the RSA host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
5c:9b:16:56:a6:cd:11:10:3a:cd:1b:a2:91:cd:e5:1c.
Please contact your system administrator.
Add correct host key in /Users/user/.ssh/known_hosts to get rid of this message.
Offending key in /Users/user/.ssh/known_hosts:1
RSA host key for server1.example.com has changed and you have requested strict checking.
Host key verification failed.
In this case, you have to clear the RSA key fingerprint in your client machine by either one of the following commands in terminal.
- ssh-keygen -R <Server IP address>
- ssh-keygen -R <Server hostname>
Try the SSH connection again, it will prompt asking if you want to add the new RSA key fingerprint. Just take yes and the connection should be established without problem. It should work in both Mac, Ubuntu and maybe other Linux OSs.
Done =)
转载请注明:江海志の博客 » MAC/LINUX出现SSH HOST KEY VERIFICATION FAILED问题解决办法