Delete stale host key entries for a host.
Section: Authorized Keys and Host Keys
Remove a host from known_hosts
bash
bash
ssh-keygen -R example.comExplanation
Delete stale host key entries for a host.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Authorized Keys and Host Keys
Add a host key to known_hosts
Append a scanned host key to your known_hosts file.
Install your public key on a server
Append your public key to a remote account's authorized_keys.