I'm unable to ssh and rysnc to a remote system. It keeps giving this error message:
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 RSA key sent by the remote host is a3:8f:7c:07:c9:12:d8:aa:cd:c2:ba:b3:27:68:bc:c2. Please contact your system administrator. Add correct host key in /root/.ssh/known_hosts to get rid of this message. Offending RSA key in /root/.ssh/known_hosts:8 RSA host key for xxx.xxx.xxx.xxx has changed and you have requested strict checking. Host key verification failed. rsync: connection unexpectedly closed (0 bytes received so far) [sender] rsync error: unexplained error (code 255) at io.c(601) [sender=3.0.8]
I've removed authorized_keys
file from /home/user/.ssh
.
You should delete the key causing the “Warning: Remote host identification has changed” error, then save your changes. You might also want to delete the entire known_hosts file, especially if you only use SSH for one or two sites. To do this, you can run rm . ssh/known_hosts in a Terminal window.
Using Config File You need to create a ~/. ssh/config file and disable strict host key checking by adding the content. This will disable host checking for all hosts you connect to. Rather than disabling host check for all Host “*”, it would be safer to specify a particular host.
Windows with PuTTY Search for regedit.exe and open it. Navigate to HKEY_CURRENT_USER/SOFTWARE/SimonTatham/PuTTy/SshHostKeys. Right click the offending key and click delete.
The known_hosts file is for verifying the identity of other systems. ssh(1) can automatically add keys to the user's file, but they can be added manually as well. The file contains a list of public keys for all the hosts which the user has connected to.
The message says "/root/.ssh/known_hosts
" not authorized_keys. Remove that file (or at least the corresponding key) from it and you can go again! But be aware that: There must be a reason why the key changed. Was the system reinstalled? Make sure you check that or the whole idea of ssh is void.
BTW.: Is there a reason you ssh as root?
use the following command which removes the old keys from .ssh/known_hosts file
ssh-keygen -R <host>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With