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 modify SSH port number in Linux

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article mainly introduces "how to modify SSH port number in Linux". In daily operation, I believe that many people have doubts about how to modify SSH port number in Linux. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubt about "how to modify SSH port number in Linux". Next, please follow the editor to study!

Tools / raw materials

Linux system of remote tools such as Xshell putty

What is SSH?

SSH is Secure Shell

Developed by IETF's Network working Group (Network Working Group)

SSH is a security protocol based on application layer and transport layer.

SSH transmission data is encrypted, which can effectively prevent the transmission process from being intercepted to ensure security.

SSH data is compressed, so it can speed up the transmission.

View SSH services

First check whether the SSH package is installed in linux, and use rpm-qa | grep ssh

two。 Confirm that the ssh service is enabled. The following editor takes the centos system as an example.

3. The path to the SSh service configuration file is usually found in the / etc/ssh directory, sshd_config this file.

END

Edit and modify SSH port number

1. Using the VI\ vim editor, open the file sshd_config and search to find the port field. The figure below is as follows

2 position the cursor over the line port 22 yy and then the keyboard P copy a line, insert insert edit port 22 is 2222

3 after setting up, as shown in the following figure, wq saves and exits, indicating that a 2222 port number has been added.

4. Once set up, of course, you need to restart the SSH service.

5. If you have set up a firewall, please modify the rules to add the firewall, or turn off the firewall directly

END

Points for attention

The default SSH port is 22. If you want to edit port 22 directly, please remove the "#" in front of it, and then save and restart.

If you are adding a port number, just follow the editor's method and add a port port.

At this point, the study on "how to modify the SSH port number in Linux" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

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

Servers

Wechat

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

12
Report