How to Change the SSH Port for Your Linux Server


The use of default SSH port information to connect to the remote server is quite sensitive. This can bring you some security risks such as hackers can use the default port to conduct your password search, use the possible bugs of the SSH server to carry out the attack. Server usage rights. So in this article I will guide you to change the default SSH port information to minimize the risk.

First, you need to log on to your server. Type nano/etc/ssh/sshd_config

Next, go to #Port 22

Remove # in front of line #Port 22 and replace the number 22 by the number you want (note: the maximum is 65536).

For example:

Save the file and type the service command sshd restart

From now on you can use SSH through the new port.

Good luck!


Please enter your comment!
Please enter your name here