Port 22 is the default port used by the SSH Linux (Open SSH) service. Changing the SSH port can add security to your server.
How do I change the SSH port of a Linux hosting server?
Step 1: Log on to the server as a root user
Step 2: Browse to the sshd_config file (can be found in /etc/ssh directory) and edit it
vim /etc/ssh/sshd_config
Step 3: Look for a command line that has:
Port 22
Step 4: Change the port number according to your wish.
Obs. Make sure the new port number is free, not being used by another service.
Step 5: If you are sure of the changes, Save
Step 6: Restart sshd using the following command:
/etc/init.d/sshd restart
Step 7: Modify the firewall, blocking port 22 and allowing the new port number used by the SSH server.
For assistance in applying the above instructions on the HostX servers, please contact us. HostX offers the best Linux hosting and can assist you in solving your problems.
