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 change the SSH port number under Linux

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

Share

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

This article mainly introduces the relevant knowledge of how to change the SSH port number under Linux, the content is detailed and easy to understand, the operation is simple and fast, and has a certain reference value. I believe you will gain something after reading this article on how to change the SSH port number under Linux. Let's take a look.

Linux is generally used as a server, and the server is generally placed in the computer room, so it is impossible for you to operate your Linux server in the computer room, so we need to log in remotely to the Linux server to manage and maintain the system. In the Linux system, the remote login function is realized through the ssh service. The default ssh service port number is 22, but the SSH port number is usually changed for security.

1. Edit the sshd_config file nano / etc/ssh/sshd_config

Search for line # Port 22, remove the first # character, and replace it with the port you want to use, for example, 2404. Make sure that there are no running services on this port 2404.

two。 Restart the sshd service service sshd restart3. [option] if you are using a firewall like iptables, you need to open port 2404. This is the end of the article service iptables stopiptables-An INPUT-m state-state NEW-m tcp-p tcp-dport 2404-j ACCEPTservice iptables saveservice iptables start on how to change the SSH port number under Linux. Thank you for reading! I believe you all have a certain understanding of "how to change the SSH port number under Linux". If you want to learn more, you are welcome to follow 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