最新消息:非无江海志,潇洒送日月

MAC/LINUX出现SSH HOST KEY VERIFICATION FAILED问题解决办法

编程开发 江海志 8910浏览 0评论

当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 MacUbuntu and maybe other Linux OSs.

Done =)

转载请注明:江海志の博客 » MAC/LINUX出现SSH HOST KEY VERIFICATION FAILED问题解决办法

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址