remove domain dns key entry in known_hosts for ssh Nov
22
1
1

Sometimes I re-key or move the domain of a server and need to reset the key so RSA doesn't complain. Technically you can just open ~/.ssh/known_hosts file and remove the entry for the dns, but the names are hashed which makes the entry difficult to find.

I used to just reset the entire known_hosts file, but that's not necessary. You can remove the domain entry with the simple command:

ssh-keygen -R example.com

Next time you try to ssh you'll be prompted to add the key as if you're visiting the site the first time. I hope this helps.

Bookmark and Share
blog comments powered by Disqus