How to Change SSH Port on VPS

How to change the SSH port on a VPS can be done on the Ubuntu or CentOS operating systems. SSH port replacement aims to make VPS security safer or not easily hacked by hackers. The default SSH port of the server itself is port 22. So for more security, you need to change the SSH port on your VPS. Changing the SSH port on a VPS definitely requires SSH access. SSH access can be done in various ways, namely if your Ubuntu operating system can use the Linux Terminal and if it's a Windows operating system you can use PuTTy Software on Windows . For more details, please read the Guide to SSH Access Through Linux Terminals and PuTTy .

How to Change SSH Port on VPS

As for how to change the SSH port on a VPS, as follows:

1. Access SSH

You can change the SSH port after logging into the server via SSH access. For SSH access steps, please read the Remote Method on VPS guide . If it appears as shown below, it means that you have successfully entered the VPS.

how to change the SSH port on the VPS

2. Select the new SSH Port

To change the value of a new port on a VPS, you need to pay attention to the port value rules to prevent misconfiguration on the server. Use dynamic / private category port values ​​with a value range of 49152-65535. Determination of the port value is done randomly. For example, you want to change the SSH port on the VPS from port 22 to port 52123.

3. Changing the SSH Port on the VPS

The steps that must be done if you want to change the SSH port on the VPS are to write the command as below on the VPS.

 

$ sudo nano /etc/ssh/sshd_config

Then you can change the SSH port on the VPS according to the port you choose. For example port 52123.

* Note: If using nano, then please right click paste. Then save by pressing ctrl + x then press "Y" and enter.

how to change the SSH port on the VPS

4. Restart SSH

When finished changing the SSH port on the VPS, the next step is to restart SSH. To restart SSH write the command below. Wait a few moments until the restart process is complete.

 

$ sudo service sshd restart

5. Restart the VPS

After that, please restart the VPS. Please enter the client area then click Serviceand click the VPS name. Then click the VPS restart button and wait a few minutes.

Then you can repeat SSH access with the new port. You can follow the guide on how to remote VPS and then enter the SSH port that has been selected. In this guide, the port is 52123.

6. SSH Port on VPS Successfully Changed

If you are successful in logging into the VPS, it means that the SSH port has been replaced successfully.

 

Conclusion

By changing the SSH port on your VPS, you are protecting your VPS from hacking by hackers. So that VPS becomes safer. To change the SSH port on a VPS the steps to remember are to first access SSH and determine the value for the new port number. SSH access can be done in 2 ways, namely through the Linux Terminal and PuTTy Software on Windows. In determining the value of the new port number, select the value range at 49152-65535 in order to prevent errors during configuration.

What is Safelink Asia?

Safelink.asia is a completely free tool where you can create short links. URL security with cryptographic algorithm. Protect your web visitors with a secure link, to avoid viruses, malware, thief, etc. Apart from being free, you get paid! Register now!


Shorten URLs & earn money

So, now you can make money from home, when managing and protecting your links with Safelink Asia. Signup for an account in just 1 minutes. Once you've completed your registration just start creating short URLs and sharing the links with your family and friends. See our proof of payment and publisher rate.


Our partners and network

Here are some of our partners and networks that have collaborated on advertising: 401XD Group, MC Project, Kincai Media, Kartu Nama Digital, SEO Secret Indonesia, Safelink Asia, Media Bisnis, Blackexpo, Adigunawan.net.