服务器重置了系统,再次连接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:WD831i/lF/k5pFzATjGUpOno2sjJHh5WwrGU5ELMIIQ.
Please contact your system administrator.
Add correct host key in /home/salt/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /home/salt/.ssh/known_hosts:64
ECDSA host key for 47.30.125.39 has changed and you have requested strict checking.
Host key verification failed.
这是因为远程服务器的公钥被修改,与本地保存的远程服务器公钥不相符, SSH在第一次连接远程服务器时,会把对方公钥存到本地的~/.ssh/known_hosts 文件中,所以把这个文件中对应服务器IP的部分删除,保存,重新连接即可。
命令行解决方法, 执行如下命令,替换IP
ssh-keygen -R 47.30.125.39
或者手动删除此IP的部分
vim ~/.ssh/known_hosts
找到对应IP部分删除,保存。