How to change SSH port on VPS with Linux based operating system?

Requirements:

In order to change SSH port for your VPS you will have a root access to it.

Changing of the SSH port of VPS:

Step 1:

Connect to the VPS server using the SSH

Step 2:

Open configuration file of the SSH using the below command

Command: #vi /etc/ssh/sshd_config

Step 3:

Locate for the below line and uncomment it (Remove #)

#Port 22

Step 4:

Replace the 22 port number with the new port number that you wish to set as SSH port for your VPS and save the file

  1. Port 8822

Step 5:

Restart ssh service to apply the changes using the below command

Command: #service sshd restart

(Note: Keep remind newly changed port number )

Step 6:

Exit the server and try to login using the new port number

Thank you for reading this article

 


Was this article helpful?

mood_bad Dislike 0
mood Like 0
visibility Views: 6389