Mac终端连接远程服务器报错WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 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
SHA256:iTzVK5/0xOLnk+QsVFJL3nCp4zvQXZmwqsJtUGON8HE.
Please contact your system administrator.

因为服务器主体发生变更了
第一次SSH连接时,会生成一个认证,储存在客户端(也就是用SSH连线其他电脑的那个,自己操作的那个)中的known_hosts,但是如果服务器验证过了,认证资讯当然也会更改,服务器端与客户端不同时,就会跳出错误啦~因此,只要把电脑中的认证资讯删除,连线时重新生成,就一切完美啦~要删除很简单,只要在客户端输入一个指令

ssh-keygen -R +输入服务器的IP

image.png

然后在重新连接:
ssh root@ip
会出现下边的 输入 yes 就行了
Are you sure you want to continue connecting (yes/no)? yes

你可能感兴趣的:(Mac终端连接远程服务器报错WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!)