Fixing bad SSH keys
Published:
Ris Adams
View profile
SSH keys are a great way to authenticate with a remote server. They are secure, and they are easy to use. However, they can be a pain to manage. If you have ever had to deal with a bad SSH key, you know what I mean. Especially if you are using cloud services where IP addresses may be reused.
If you are connecting to a known host, where the IP address has changed, or if the IP has been reassigned to a different host, it become necessary to remove the old key from your known hosts file. This can be done with the following command:
ssh-keygen -R [IP]