当前位置:网站首页>Solve the problem that the server cannot be connected via SSH during reinstallation

Solve the problem that the server cannot be connected via SSH during reinstallation

2022-06-30 12:18:00 Nagging program dog

The cause of the problem

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 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:+U+xy3dOfsLZ4KWbCUQvfajA//gL/FIYxaVPFcbkSQU.
Please contact your system administrator.
Add correct host key in /Users/liu_pc/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /Users/liu_pc/.ssh/known_hosts:1
ECDSA host key for ip has changed and you have requested strict checking.
Host key verification failed.

When we Linux After the server chooses to reinstall the system , Again using ssh [email protected] When logging into the server from the command line , An error will be reported as above , The reason is that the computer where our command line is located is connected to the server successfully for the first time , Will record a ip+RSA The secret key to , Due to server reinstallation ,Linux Server's RSA Public key change , So the same ip The public keys of the two cannot be matched , So there will be this problem .

The solution to the problem

edit Mac Under the system user file known_hosts file . Due to inconsistent individual user names , Please change the command by yourself .

vi /Users/liu_pc/.ssh/known_hosts

image-20220625105444742

Normally there will be ip + rsa The text of the public key , stay vi Use the insert mode to delete the corresponding ip+rsa The text of the public key .

Use :wq Save the file .

And then use ssh Command login .

原网站

版权声明
本文为[Nagging program dog]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/181/202206301156197304.html