SSH (OpenSSH) 10 · Keys and agent

Remove an old host key

Remove a host from known_hosts after its key legitimately changed, such as after reinstalling.

ssh-keygen -R example.com

Caution: A changed host key can also mean someone is intercepting your connection. Make sure the change is expected.

Official SSH (OpenSSH) 10 documentation

More keys and agent commands

All keys and agent commands · SSH (OpenSSH) 10 cheatsheet

Was this page helpful?