0

SSH Error : WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!

I am trying to do Rsync over a remote host but every time it says add correct host key in /root/.ssh/known_hosts to get rid of this message?

Error-handling Add a comment
rebeccajazz
asked Dec 26 2020

Answer

0

When you connect to a server via SSH, it gets a fingerprint for the ECDSA key, which then saves to your home directory under ~/.ssh/known_hosts. This is done after first connecting to the server, and will prompt you with a message like

Are you sure you want to continue connecting y/n

If you enter 'yes', then the fingerprint is saved to the known_hosts file, which SSH then consults every time you connect to that server.

if a server's ECDSA key has changed since you last connected to it. it could actually mean that you're connecting to a different server without knowing it. If this new server is malicious then it would be able to view all data sent to and from your connection, which could be used by whoever set up the server. This is called a man-in-the-middle attack

So to fix Issue

Remove the old Keys in you file location /root/.ssh/known_hosts using

ssh-keygen -f "/root/.ssh/known_hosts" -R <host ip>

this method will solve the error encountering in rsync process with ssh

Add a comment
linuxhelp
asked Dec 26 2020
Post your Answer