Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to check the ssh version in Linux

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

Today, the editor will share with you the relevant knowledge points about how to view the ssh version in Linux. The content is detailed and the logic is clear. I believe most people still know too much about this knowledge, so share this article for your reference. I hope you can get something after reading this article. Let's take a look.

Method one

If you want to check the SSH version supported by your local OpenSSH server, you can refer to the / etc/ssh/sshd_config file. Open / etc/ssh/sshd_config with a text editor and view the "Protocol" field.

If shown below, it means that the server only supports SSH2.

Protocol 2

If shown below, it means that the server supports both SSH1 and SSH2.

Protocol 1 method 2

If you can't access / etc/ssh/sshd_config because the OpenSSH service is running on a remote server. You can use a SSH client called ssh to check the supported protocols. Specifically, it forces ssh to use a specific SSH protocol, and then we look at 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 appear with an error message like the following:

Protocol major versions differ: 1 vs. 2

If the SSH server supports both SSH1 and SSH2, both commands are valid.

Method three

Another way 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 set of IP addresses or the entire local network to upgrade SSH1-compliant SSH servers.

Here is the basic SSH version scanning syntax.

Sudo scanssh-s ssh-n [ports] [IP addresses or CIDR prefix]

The "- n" option specifies the SSH port to scan. You can scan multiple ports with all-good separation. Without this option, scanssh will scan port 22 by default.

Use the following command to discover the SSH server in the 192.168.1.0 Compact 24 local network and check the v version of the SSH protocol:

Sudo scan-s ssh 192.168.1.0 take 24

If scanssh reports "SSH-1.XX-XXXX" for a specific IP address, this implies that the minimum version supported by the relevant SSH server is SSH1. If the remote server only supports SSH2,scanssh, "SSH-2.0-XXXX" will be displayed.

These are all the contents of the article "how to check the ssh version in Linux". Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report