Penek's Shenanigans

SSH Mismatch

I have an unhealthy habit of reinstalling the operating system of my server so that I can test out initialization scripts. This used to be fine when there was only me on the server. But since I now provide some services to others, I have made a mistake.

WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!

While this warning does not elicit any fears for the person reinstalling, it certainly does for others. This warning is very much expected when an OS is reinstalled. It exists to warn you that there is a mismatch between the host key entry in your known_hosts file and the actual host key present in the server. To reauthenticate, you must remove the old entry from your known_hosts file, so SSH can accept the new host key. You can do so manually or use the command provided in the warning. A simple version of this is as follows:

ssh-keygen -R ip_address

Substitute ip_address with the actual IP Address or Domain Name of the host server. The next time you connect, you'll be able to accept the new host key and continue on with your adventure.