centos spc error

  After reinstalling the system, scp the file from another machine, the following prompt appears, it is possible to scp before the reinstallation.

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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 the RSA host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
62:7c:e9:74:26:2b:58:cb:7c:45:53:6a:65:be:9f:2e.
Please contact your system administrator.
Add correct host key in /root/.ssh/known_hosts to get rid of this message.
Offending key in /root/.ssh/known_hosts:1
RSA host key for 192.168.7.171 has changed and you have requested strict checking.
Host key verification failed.
lost connection
     Baidu checked and solved it immediately. Once again, I really appreciate the convenience of the network and the selfless sharing of netizens.

Methods as below:

On the machine running scp, find the following ssh connection folder in the user's home directory:
1. cd ~/.ssh/
2. vi known_hosts
3. Find the key storage information consistent with the remote host ip, and delete it directly by dd , then: x save and exit
4. Reconnect, enter the password, and find that the connection is successful

problem solved. It turned out that the key before the reinstallation was recorded, so an error occurred. It's OK to get it again after deleting it.

General commands for scp:

Transfer files: scp filename  username@ip:dir , such as scp a.txt  [email protected]:/home/aa

Transfer folder: scp -r dir  username@ip:dir , such as scp -r bb  [email protected] : /home/aa

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326664401&siteId=291194637