3

Remove offending key from known_hosts file with one swift move

ssh-keygen -R <hostname>

January 25, 2014openiduser126

Explanation

The ssh-keygen tool comes with an option for this already, there is no need for esoteric one-liners that are hard to remember.

Say you ssh server.example.com and its host key has changed because you just reinstalled it. Run ssh-keygen -R server.example.com then try to connect to the server again, you'll be presented with the option to save the host key just like new.

Related one-liners

3