之前ssh登录服务器一直正常,昨天重装系统后出现下面这样的提示,导致无法登录。
ssh root@111.222.333.444 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ 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:9b06teWEQbQHWpEi1N8ZwpsCD0CZ68yPj+XQWzMmIE0. Please contact your system administrator. Add correct host key in /Users/yakimateng/.ssh/known_hosts to get rid of this message. Offending RSA key in /Users/yakimateng/.ssh/known_hosts:9 RSA host key for 154.204.32.215 has changed and you have requested strict checking. Host key verification failed.
解决方案:vi ~/.ssh/known_hosts 打开用户目录下的.ssh/known_hosts文件,找到登录ip(如111.222.333.444,这里的ip是瞎写的,换成你自己ssh登录时的实际ip地址),把相关行的文本删掉,然后:wq 回车保存即可。