Remove an offending SSH host key from known_hosts

Sometimes you may need to remove old ssh host keys from your known_hosts file. While you can edit this file by hand, there’s also a command that will let you remove the offending key(s) based on the hostname or IP:

ssh-keygen -R <Hostname or IP Address>

Be the first to comment

Leave a Reply

Your email address will not be published.