Remove an outdated host from known_hosts
remote host identification has changed fix | remove host from known_hosts | ssh-keygen -R host | ssh-keygen | known-hosts | host-keyCaution: This command changes the system. Understand what it does before you run it.
ssh-keygen -R server.example.comRemoves all entries for a host from ~/.ssh/known_hosts, even if the file contains hashed hostnames. Useful when a server has been reinstalled and SSH therefore refuses to connect with a warning. A backup of the old file is saved as known_hosts.old.
Note: Only run this if the key change can be explained. An unexpected change may indicate a man-in-the-middle attack. For a non-standard port, the syntax is [host]:2222.
Also searched as
- remote host identification has changed fix
- remove host from known_hosts
- ssh-keygen -R host