ssh 登录 WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!

重置了服务器的系统,再次通过 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:6PPclq4j/25+Ysddndfffdsdfwe7Lyj4JkXUMWkm0pc.
Please contact your system administrator.
Add correct host key in /root/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /root/.ssh/known_hosts:15
ECDSA host key for vpsok.com  has changed and you have requested strict checking.
Host key verification failed.

这个错误表示远程主机的ECDSA密钥已经变更,与本地存储的密钥不匹配。可能的原因包括:

  1. 远程服务器确实更换了密钥(比如重装系统)
  2. 可能存在中间人攻击(虽然概率较低)
  3. 服务器IP地址被重新分配给了另一台主机

解决方法 删除指定域名主机的记录

ssh-keygen -R [主机名或IP地址]

或者按照提示删除15行 /root/.ssh/known_hosts:15

Add correct host key in /root/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /root/.ssh/known_hosts:15

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注