Add correct host key in /root/.ssh/known_hosts to get rid of this message

May 19, 2015 8.8k views
Security Nginx

When try to login to remote server from my local machine using terminal I get the following message
<^>Please contact your system administrator.
Add correct host key in /root/.ssh/knownhosts to get rid of this message.
Offending ECDSA key in /root/.ssh/known
hosts:5
remove with: ssh-keygen -f "/root/.ssh/known_hosts" -R 45.55.154.139
Password authentication is disabled to avoid man-in-the-middle attacks.
Keyboard-interactive authentication is disabled to avoid man-in-the-middle attacks.<^>

I generated rsa key from server by using the following command

ssh-keyscan -t rsa ip_address

```added the rsa key to known_hosts file in my local machine, but still I am getting this issue

1 Answer

use this:

ssh-keygen -R SERVERIPADDRESS

Have another answer? Share your knowledge.