ssh连接失败,提示 WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!

ssh -p 29418 -i ~/.ssh/id_rsa localhost -l sherry
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 RSA key sent by the remote host is
SHA256:RuFWcXWowqW6aUvRPqdQS9wBsBtU5rdDSuZCPFcDe2I.
Please contact your system administrator.
Add correct host key in /Users/zhaorui/.ssh/known_hosts to get rid of this message.
Offending RSA key in /Users/zhaorui/.ssh/known_hosts:6
RSA host key for [localhost]:29418 has changed and you have requested strict checking.
Host key verification failed.

原因:提示中间人攻击,之前连接过该主机未成功,但是写到了known_hosts中。
解决办法:

vi ~/.ssh/known_hosts

删掉localhost(根据你连接的主机ip)的记录(一行),重新连接即可

你可能感兴趣的:(环境配置,系统设置)