Linux server modifies the default remote connection port

1. Log in to the Linux server.

 

2. Edit the ssh service configuration file:

vi /etc/ssh/sshd_config

Note: The ssh service configuration file is generally in the above directory, but special circumstances need to be paid attention to 

 3. Move the cursor to "#22", press "i" to enter the edit mode, modify the port to the port you want, press "Esc" ":wq" to save and exit.

4. Restart the ssh service:

systemctl restart sshd 

 5. Test the remote connection: the default port 22 connection fails, and the modified port 1212 connection succeeds.

 

Guess you like

Origin blog.csdn.net/wd520521/article/details/126060534