Bug 2690

Summary: Add command line "ssh --version"
Product: Portable OpenSSH Reporter: jg
Component: sshAssignee: Assigned to nobody <unassigned-bugs>
Status: CLOSED WORKSFORME    
Severity: enhancement CC: dtucker
Priority: P5    
Version: 7.2p2   
Hardware: Other   
OS: Linux   

Description jg 2017-03-07 18:38:08 AEDT
I am using
ssh -V
OpenSSH_7.2p2 Ubuntu-4ubuntu2.1, OpenSSL 1.0.2g  1 Mar 2016


Would you support a patch to add "ssh --version" this is the standard way to check the version, it is unclear what version ssh from the help output, so could add it to that as well. If there was agreement.

$ ssh
usage: ssh [-1246AaCfGgKkMNnqsTtVvXxYy] [-b bind_address] [-c cipher_spec]
           [-D [bind_address:]port] [-E log_file] [-e escape_char]
           [-F configfile] [-I pkcs11] [-i identity_file] [-L address]
           [-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port]
           [-Q query_option] [-R address] [-S ctl_path] [-W host:port]
           [-w local_tun[:remote_tun]] [user@]hostname [command]


I would suggest adding the version to this output as well. And also --version command line on the parameters
Comment 1 Darren Tucker 2017-03-07 19:41:10 AEDT
(In reply to jg from comment #0)
> Would you support a patch to add "ssh --version" this is the
> standard way

--version (and long options in general) are not standard (see http://pubs.opengroup.org/onlinepubs/9699919799/functions/getopt.html), they're a GNU extension.

So, no, probably not.
Comment 2 jg 2017-03-09 17:13:42 AEDT
I appreciate that GNU long options aren't part of POSIX, but when they are so common, is it not worth being GNU compatible now?

The other question, is could the usage be updated to include the current version? eg

$ ssh
 OpenSSH_7.2p2 Ubuntu-4ubuntu2.1, OpenSSL 1.0.2g  1 Mar 2016
usage: ssh [-1246AaCfGgKkMNnqsTtVvXxYy] [-b bind_address] [-c cipher_spec]
           [-D [bind_address:]port] [-E log_file] [-e escape_char] [-V]
           [-F configfile] [-I pkcs11] [-i identity_file] [-L address]
           [-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port]
           [-Q query_option] [-R address] [-S ctl_path] [-W host:port]
           [-w local_tun[:remote_tun]] [user@]hostname [command]
Comment 3 Darren Tucker 2017-03-10 13:33:08 AEDT
(In reply to jg from comment #2)
> I appreciate that GNU long options aren't part of POSIX, but when
> they are so common, is it not worth being GNU compatible now?

No.

> The other question, is could the usage be updated to include the
> current version? eg

It's not relevant to the usage, so probably not.

Thanks for the suggestions but they are not something we are interested in implementing at this time.
Comment 4 Damien Miller 2021-04-23 14:56:27 AEST
closing resolved bugs as of 8.6p1 release