Mac ssh时遇到‘Host key verification failed’错误

服务器重新装过,所以再ssh的时候遇到了:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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:######.
Please contact your system administrator.
Add correct host key in /Users/###/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /Users/###/.ssh/known_hosts:2
ECDSA host key for ### has changed and you have requested strict checking.
Host key verification failed.

解决方法:

ssh-keygen -R xxx.xxx.xxx.xxx(ur ip address)

你可能感兴趣的:(linux)