We observe that aside from the first run below, the message "/home/jidanni/.ssh/known_hosts updated." is incorrect. Using diff(1) we show that the contents remain the same. Therefore in the latter cases, saying "/home/jidanni/.ssh/known_hosts NOT updated." would be better. Nor is there any reason to write a backup. $ ssh-keygen -f "/home/jidanni/.ssh/known_hosts" -R m.jidanni.org # Host m.jidanni.org found: line 2 type RSA /home/jidanni/.ssh/known_hosts updated. Original contents retained as /home/jidanni/.ssh/known_hosts.old $ ssh-keygen -f "/home/jidanni/.ssh/known_hosts" -R m.jidanni.org /home/jidanni/.ssh/known_hosts updated. Original contents retained as /home/jidanni/.ssh/known_hosts.old $ ssh-keygen -f "/home/jidanni/.ssh/known_hosts" -R m.jidanni.org /home/jidanni/.ssh/known_hosts updated. Original contents retained as /home/jidanni/.ssh/known_hosts.old $ diff /home/jidanni/.ssh/known_hosts.old /home/jidanni/.ssh/known_hosts $ Yes you might think it odd that a user would repeat the command by accident perhaps, but even more odd are the incorrect messages.
This was fixed in openssh-6.8 by another change: $ ./ssh-keygen -R test.example.com # Host test.example.com found: line 157 home/djm/.ssh/known_hosts updated. Original contents retained as /home/djm/.ssh/known_hosts.old $ rm -f /home/djm/.ssh/known_hosts.old $ ./ssh-keygen -R test.example.com Host test.example.com not found in home/djm/.ssh/known_hosts $ ls -l /home/djm/.ssh/known_hosts.old ls: cannot access /home/djm/.ssh/known_hosts.old: No such file or directory
Set all RESOLVED bugs to CLOSED with release of OpenSSH 7.1