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

A simple method for Linux system to change SSH Port

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

Share

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

As we all know, if you are renting a Linux system VPS or server, you need to manage it through a SSH terminal. In general, the default port for SSH terminal login is 22. If you use the default port 22, it will cause some security risks to the server, so you can change its port if necessary.

Let's briefly talk about how the Linux system changes the SSH port. Because you need to edit the SSH configuration file, you can use the text editor you want to use, but for this article, you will use the Linux text editor Nano as follows.

Step 1: change the directory to / etc/ssh/ with the following command:

Cd / etc/ssh/

Step 2: here you need to back up the current sshd_config to do this, run the following command:

Cp sshd_config sshd_config.bak

Step 3: now you need to edit the sshd_config file with the following command:

Nano sshd_config

Step 4: in Nano, search for "port" by pressing ctrl+w, then type in the port and press Enter.

Step 5: once the port setting is found, you can delete the # symbol and uncomment the line

Step 6: change the port number (22) to any port below 65535 that you want to set.

Step 7: the following ports are not recommended because they are usually already occupied by other processes.

251104434952180208320822086208720969876

You can use cat/etc/services to view the port number currently configured on the server.

Step 8: finally, restart the SSH service using the following command:

Service sshd restar

In this way, you can change the Linux system to change the SSH port number through the above steps, and the setup process is for reference only. The above process in the www.appjzw.com site where the server setting is no problem, if you encounter any problems in the setting process, welcome to discuss!

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