How To Fix the SSH – “Warning: Remote Host Identification Has Changed” Error on Windows and MAC

Estimated reading: 2 minutes 793 views

The occurrence of the “Warning: Remote host identification has changed” error is intended to protect your connection from potential malicious attacks, although sometimes it can be unintentionally triggered.

This error is associated with Secure Shell (SSH) keys and the server’s “fingerprint” that a client checks for. When Secure Shell detects an issue, it blocks access to your server and displays an error message. However, you can resolve this problem by following a few simple steps.

In this article, we will look at how to fix the above problem.

How to fix SSH “Warning: Remote host identification has changed” on Windows

Step 1. It’s worth noting that Windows machines may not have a known_hosts file, but if you use the OpenSSH client, such a file exists. To locate it, open the Windows search bar and enter the command “%USERPROFILE%” to access your user folder.

Step 2. This will open the File Explorer, and navigate to the .ssh folder.

Step 3. Locate and delete the known_hosts file

Then you can try again.

For PuTTY users, the keys are stored in the Registry. Follow these steps:

Step 1. Access the Windows Registry Editor (“regedit”) through Windows Key + R.

Step 2. Navigate to this path:

HKEY_CURRENT_USER/Software/SimonTatham/PuTTY/SshHostKeys/

Step 3. You will see a list of entries representing the saved connections on your computer. Delete the entry that is causing the issue:

 

By following these steps, you will permanently remove the key, and the “Warning: Remote host identification has changed” error should no longer appear.

 

How to fix SSH “Warning: Remote host identification has changed” on Mac

There is a method for fixing the “Warning: Remote host identification has changed” on Mac. You can use the Terminal.

Step 1. Start by opening the Terminal using your preferred method:

Step 2. In the Terminal window, enter the command “nano ~/.ssh/known_hosts” to open a new Nano instance and display the keys in your known_hosts file:

Step 3. Delete the key in the known_hosts file then save your change

Then try SSH again.

Conclusion

In our case after performing the above steps, we did not see the error again.

Hopefully, this article will be useful for you. Good luck!


Share this Doc

How To Fix the SSH – “Warning: Remote Host Identification Has Changed” Error on Windows and MAC

Or copy link

CONTENTS