ssh-keygen -R is currently removing *all* comments from the known_hosts file it's processing. Below is an example of ssh-keygen -R being run on a test known_host file. An attachment is included that demonstrates the problem in action. Notice that the first invocation is to remove example1.server.net from the file, but the comment on example2.server.net is removed in the process as well. The same problem occurs when nothing no host is removed from the file at all. In both cases an attempt was made to remove a host *other* than example2.server.net, but the net result was that *all* comments where removed from the file. Thanks for the help.
Created attachment 1589 [details] example output of ssh-keygen -R that removes all comments
See also bug #1544
We are freezing for the OpenSSH 5.6 release. Retargetting these bugs to the next release.
Targetting OpenSSH 5.7
Retarget unclosed bugs from 5.7=>5.8
Retarget unresolved bugs/features to 6.0 release
Retarget unresolved bugs/features to 6.0 release (try again - bugzilla's "change several" isn't)
Created attachment 2103 [details] bz1545.diff retain comments in known_hosts when hashing/deleting entries
Retarget from 6.0 to 6.1
Retarget 6.0 => 6.1
Retarget uncompleted bugs from 6.1 => 6.2
Retarget bugs from 6.1 => 6.2
retarget to openssh-6.3
looks like there is a patch for this that has been available since a few upstream versions. What's keeping the patch from being adopted? This is a user data loss issue :/
Created attachment 2272 [details] patch against 6.2 I've updated the patch so that it applies against 6.2p1
Retarget to openssh-6.4
Retarget 6.3 -> 6.4
Retarget incomplete bugs / feature requests to 6.6 release
Retarget to 6.7 release, since 6.6 was mostly bugfixing.
Remove from 6.6 tracking bug
Retarget incomplete bugs to 6.8 release.
These bugs are no longer targeted at the imminent 6.7 release
I just committed a big refactoring of known_hosts processing that should fix this.
openssh-6.8 is released