SSH连现时出现“WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!”解决办法

Mac 或Linux系统使用终端命令连接远程服务器的时候,可能会遇到如下错误:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 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

会出现这讯息是因为,第一次SSH连现时,会生成一个认证,储存在客户端(也就是用SSH连线其他电脑的那个,自己操作的那个)中的known_hosts,但是如果伺服器端重灌过了,认证资讯当然也会更改,伺服器端与客户端不同时,就会跳出错误啦~

因此,只要把电脑中的认证资讯删除,连线时重新生成,就一切完美啦~

要删除很简单,只要在客户端输入一个指令

ssh-keygen -R 伺服器端的IP或网址

参考地址:
http://anal02.pixnet.net/blog/post/116259769-%5Blinux%5D-%E9%8C%AF%E8%AA%A4-ssh%E9%80%A3%E7%8F%BE%E6%99%82%E5%87%BA%E7%8F%BE%E3%80%8Cwarning%3A-remote-host-ide

https://zhaohonghao.wordpress.com/2015/05/11/ssh%E8%BF%9E%E7%8E%B0%E6%97%B6%E5%87%BA%E7%8E%B0%E3%80%8Cwarning-remote-host-identification-has-changed%E3%80%8D%E8%A7%A3%E5%86%B3%E5%8A%9E%E6%B3%95/

你可能感兴趣的:(SSH连现时出现“WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!”解决办法)