Categories
Web Server

Add correct host key in known_hosts

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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
[...].
Please contact your system administrator.
Add correct host key in /home/root/.ssh/known_hosts to get rid of this message.
Offending RSA key in /home/root/.ssh/known_hosts:86
RSA host key for [...] has changed and you have requested strict checking.
Host key verification failed.

Fix

ssh-keyscan -t rsa [IP ADDRESS]
ssh-keyscan -t rsa 192.168.44.44

Example response,

# 192.168.44.44 SSH-2.0-OpenSSH_4.3
192.168.44.44 ssh-rsa AAAAB3NzaC1yc2EAAAGDSGAAAQEAwH5EXZG...

Add the entire line in known_hosts

# nano ~/.ssh/known_hosts
192.168.44.44 ssh-rsa AAAAB3NzaC1yc2EAAAGDSGAAAQEAwH5EXZG...