What to do when you get the error “REMOTE HOST IDENTIFICATION HAS CHANGED” when you try to connect to a device using SSH in Windows Terminal. This error occurs when the fingerprint of the remote host you’re trying to connect has changed. In my case I got this error when I reinstalled my Raspberry Pi and tried to connect to it.
How to fix it!
In the next steps I will show how to fix this issue. So when you try to connect to a device and get the following error you need to be careful if you haven’t changed anything. Because as it states “Someone could be eavesdropping” or a “Man-in-the-middle attack” maybe carried out.
The fingerprints of the SSH sessions you connect are recorded in the Known_hosts file. So if something changes you need to correct it in this file. If you just like me did something that could have changed the host key you have 2 options:
- Correct the host key in the known_hosts file.
- Delete the known_hosts file. (lazy way)
If you’re connecting to multiple devices using SSH you may want to perform step 1 and correct the fingerprint in the known_hosts file. But if you just like me and use SSH casually the most simple option is deleting the known_hosts file. The next time you will connect it will be automatically recreated. I will show how to remove the file.
1. Browse to “C:\Users\<USERNAME>\.ssh\”. Select the “known_hosts” files and select “delete”
2. Both files should be removed.
3. Try to connect to the host using “Terminal” and enter “yes” to continue and create a new “known_hosts” file and connect to the device.
I’ve created this blog as a reminder for myself, but this will possible help others with the same issue.




