ssh-keygen -R

September 2nd, 2007 by webstersprodigy

This is the correct way to remove old public keys from your known_hosts file.

There are times when public keys change for legitimate reasons.  Like when you get a new operating system installed or something.

In the past, I’ve just edited .ssh/known_hosts and deleted the entries (there is normally at least two, one for the IP and one for the host name).  This can be a bit hard because these entries aren’t really labeled clearly.

A better way is to:

ssh -R hostname
ssh -R IP

Leave a Reply


No computers were harmed in the 0.184 seconds it took to produce this page.