If you want to check the SSH protocol version supported by the local OpenSSH server, refer/Etc/ssh/sshd_config file. Open/etc/ssh/sshd_config in a text editor and view the "Protocol" field.
Method 2If the OpenSSH service runs on a remote server, you cannot access/etc/ssh/sshd_config. You can use an ssh client called SSH to check supported protocols. Specifically, it is to force ssh to use a specific SSH protocol. Then I will check the response of the SSH server.
The following Command Forces ssh to use SSH1:
$ ssh -1 user@remote_server
The following Command Forces ssh to use SSH2:
$ ssh -2 user@remote_server
If the remote SSH server only supports SSH2, the first option with "-1" will display the following error message:
Protocol major versions differ: 1 vs. 2
If the SSH server supports both SSH1 and SSH2, both commands are valid.
Method 3Another method to check the version is to run the SSH scanning tool, called scanssh. This command line tool is useful when you want to check a group of IP addresses or upgrade SSH1 compatible SSH servers over the local network.
The following is the basic SSH Version scan syntax.
$ sudo scanssh -s ssh -n [ports] [IP addresses or CIDR prefix]
The "-n" option specifies the SSH port to be scanned. You can scan multiple ports with good separation. Without this option, scanssh will scan port 22 by default.
Run the following command to find the SSH server in the local network of 192.168.1.0/24 and check the SSH protocol v version:
$ sudo scan -s ssh 192.168.1.0/24
If scanssh reports "SSH-1.XX-XXXX" for a specific IP address, it implies that the minimum version supported by the relevant SSH server is SSH1. if the remote server only supports SSH2, scanssh displays "SSH-2.0-XXXX ".
Via: http://ask.xmodulo.com/check-ssh-protocol-version-linux.html
Translator: geekpi Proofreader: wxy
This article was originally translated by LCTT and launched with the Linux honor in China