Bug 2935

Summary: improve documentation of "ssh-keygen -R" to mention "[hostname]:port"
Product: Portable OpenSSH Reporter: Thomas Hofmann <thomas>
Component: ssh-keygenAssignee: Assigned to nobody <unassigned-bugs>
Status: CLOSED FIXED    
Severity: enhancement CC: djm
Priority: P5    
Version: 7.9p1   
Hardware: Other   
OS: Linux   
Bug Depends on:    
Bug Blocks: 2915    

Description Thomas Hofmann 2018-11-29 23:26:47 AEDT
Improve the documentation of ssh-keygen's -R parameter to explicitly describe how to delete the line in the "known_hosts"-file for non-standard port connections.

current: 
___
 -R hostname
             Removes all keys belonging to hostname from a known_hosts file.  This option is useful to delete hashed hosts (see the -H option above).
___

proposed:
___
 -R hostname
 -R [hostname]:port
             Removes all keys belonging to hostname and port from a known_hosts file, brackets and ":port" may be ommited if the standard port (22) is used.  This option is useful to delete hashed hosts (see the -H option above).
___

Personal remark, at least in the documentation the use of "[]" may lead to misinterpretation, therefore the explicit notion of them in the proposal. It would seem that the use of the representation as "hostname:port" is more natural.

Kind regards,
Thomas Hofmann
Comment 1 Damien Miller 2018-12-07 14:33:59 AEDT
Fixed - it now reads:

 -R hostname | [hostname]:port
      Removes all keys belonging to the specified hostname (with
      optional port number) from a known_hosts file.  This option is
      useful to delete hashed hosts (see the -H option above).
Comment 2 Damien Miller 2021-04-23 14:54:56 AEST
closing resolved bugs as of 8.6p1 release