阿里云服务器ECS,重置系统后 出现 REMOTE HOST IDENTIFICATION HAS CHANGED 问题解决

今天重置服务器后,连接出现以下错误

# Host 123.56.221.254 found: line 1

/var/root/.ssh/known_hosts updated.

Original contents retained as /var/root/.ssh/known_hosts.old

MacBookdeMacBook-Pro:~ macbook$ ssh [email protected]

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

@    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:lT6FPZDEww/DmyoPTxfUTI4rn17rTHWTncxCFWzavco.

Please contact your system administrator.

Add correct host key in /Users/macbook/.ssh/known_hosts to get rid of this message.

Offending ECDSA key in /Users/macbook/.ssh/known_hosts:12

ECDSA host key for 123.56.221.254 has changed and you have requested strict checking.

Host key verification failed.


问题在于:第一次SSH连接时,会生成一个本地密钥,储存在客户端的known_hosts中,每次登陆时候该密钥验证。

                  重置系统之后生成新的密钥,导致本地的旧密钥不匹配服务端的新密钥

步骤如下:

1, 进入路径  cd ~/.ssh
2, 进入文件 vim known_hosts 
3, 删除 known_hosts里面关于 对应云服务器IP 的信息,保存退出即可






你可能感兴趣的:(web,python,Linux)