下午连 SSH 的时候发现连接不上了
JirehdeMacBook-Pro:~ jireh$ ssh root@xxx.xxx.xxx.xxx
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 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:6X749AzRgZtBAG2ftdGaf0BAhdpqZoRhnevPJhXR1z0.
Please contact your system administrator.
Add correct host key in /Users/jireh/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /Users/jireh/.ssh/known_hosts:2
ECDSA host key for xxx.xxx.xxx.xxx has changed and you have requested strict checking.
Host key verification failed.
想想可能是根据自己刚才,重装了系统导致,结果 SSH 使用旧密钥连接,但是服务器已经更新了所以连接不上。
查了下资料可以在终端中输入
ssh-keygen -R xxx.xxx.xxx.xxx | 这里 xxx.xxx.xxx.xxx 就是你服务器的 IP 地址
这样就可以清除啦。