Steps to Change SSH Port of a Server
Port 22 is that the default port used by a Linux SSH Server (Open SSH). This can be not simply best-known to the server administrators however the hackers and attackers as well. Well incase you have implemented totally different security measures for your web hosting server, then it should not be a priority for you. However, changing the port of your SSH will add the safety of your server.
Changing the default port 22 to something else on your hosting server is one thing like preventing the hackers from accessing your server from the front door. Though you should to note that this method wouldn’t make your server 100% safe from intrusion, however it will definitely keep professional hackers busy with finding alternative vulnerabilities on the server and it might enhance the SSH Security of Server.
Following are the steps that shows how to change the SSH port of a Linux Hosting Server ?
Step 1 : Login to your server as Root administrator
Step 2 : Search for the sshd_config file (it can be found in /etc/ssh directory) and edit it in this file.
vim /etc/ssh/sshd_config
Step 3 : After that search for a line that contains :
Port 22
Step 4 : You have to amend the port number with something of your preference .
Note : You have to make sure that the new port number is totally free and isn’t used by any other service.
Step 5 : Once you’re certain regarding the changes, make sure that you Save the file
Step 6 : You have to then restart sshd using the command given below:
/etc/init.d/sshd restart
Step 7 : With blocking Port 22, make changes to the firewall and allowing the new Port number used by SSH.