How to fix the “SSH Remote Host Identification Has Changed” error

In this tutorial, I will try to explain how you can fix the SSH error to the remote machine which has a different digital fingerprint now as compared to the previous fingerprints.

When a server is recycled or reclaimed you might see a message like this one:

@@@@@@@@@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @@@@@@@ IT IS POSSIBLE THAT SOMEONE IS D​​OING SOMETHING NASTY! ……………………………………………..

Offending key in /Users/YourName/.ssh/known_hosts:779 RSA host key for [root@test ~]: 2200 has changed and you have requested strict checking.Host key verification failed.

We can fix this by disabling the key check or by updating your ~/.ssh/known_hosts file. This guide will teach you how to update the file.

1. Updating your known-hosts file

All host keys are stored in the known-hosts file, which is located on the .ssh directory of your user. While you can fix this by manually updating the file, the easiest way is using ssh-keygen.

On your terminal, issue the following command:

[root@test ~]# ssh-keygen -R server

Now just replace server with the actual server name, like test.mylinuxtips.info for example, and you are done.

Leave a Reply

Your email address will not be published. Required fields are marked *