Solve the SSH remote login problem after resetting the ECS of Alibaba Cloud server Host key verification failed

Shown as follows:

$ 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:HDjXJvu0VYXWF+SKMZjSGn4FQmg/+w6eV9ljJvIXpx0.
Please contact your system administrator.
Add correct host key in /Users/wangdong/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /Users/wangdong/.ssh/known_hosts:46
ECDSA host key for 192.168.9.152 has changed and you have requested strict checking.
Host key verification failed.

In this, there is a very important sentence.

ECDSA host key for 192.168.9.152 has changed and you have requested strict checking.
Host key verification failed.

Generally, this problem is after you reset your server. This problem occurs when you want to visit again.

2. Solving the problem
Solving the problem is also very simple:

ssh-keygen -R 你要访问的IP地址

E.g:

ssh-keygen -R 192.168.9.152

Guess you like

Origin blog.csdn.net/qq_43030934/article/details/107217360