when a host with a non-default port is in the known_hosts file then the suggested command to remove it does not work: in known_hosts: [192.168.42.129]:2222 ssh-rsa .... connecting with an outdated hostkey gives: Offending ECDSA key in /home/user/.ssh/known_hosts:440 You can use following command to remove all keys for this IP: ssh-keygen -R 192.168.42.129 -f /home/user/.ssh/known_hosts That command does only work for this known_hosts entry. It only works via: keygen -R [192.168.42.129]:2222 -f /home/user/.ssh/known_hosts
"That command does only work for this known_hosts entry" should read: "That command does NOT work for this known_hosts entry"
That text has been added by a downstream distributor of OpenSSH, probably your OS distribution. It isn't in the version that we release.
Set all RESOLVED bugs to CLOSED with release of OpenSSH 7.1
For future reference, this bug affects SUSE distributions, and I have submitted a downstream bug here: https://bugzilla.suse.com/show_bug.cgi?id=1006221