Change the default SSH port 22 under CentOS to other ports

Everyone knows that SSH default port 22 is actually very detrimental to the security of the server website. In order to make the website more secure, we can modify the SSH default port 22 to other ports. Let’s take a look at the specific modification steps.

 

1. Modify the configuration file: /etc/ssh/sshd_config and find "#port"

2. First remove the # sign in front of Port 22 and start a new line. If the SSH port number is defined as 57122, enter Port 57122 to customize the port. It is recommended to select a port in the tens of thousands (for example: between 10000-65535)

 

 3. After pressing the esc key, enter: wq to save

4. Restart the ssh service, service sshd restart, as shown in the figure below

Guess you like

Origin blog.csdn.net/mars131458/article/details/131557795