Portal Home > Knowledgebase > Virtual Private Servers > Budget VPS > How to change your SSH port


How to change your SSH port




Changing your SSH port can be a key part in keeping your VPS or Dedicated server clear from hackers.?

?

To do this we will need to have nano installed on your VPS.?

Once SSHd in run the command?

whereis nano


You should see something along the lines of?

nano: /bin/nano /usr/bin/nano /usr/share/nano /usr/share/man/man1/nano.1.gz

If you do not run?
yum install -y nano


Once here you will need to change your directory to /etc/ssh/sshd_config


Here you will want to make a backup of your current sshd_config to do this run the following command.

cp sshd_config sshd_config.bak

At this poing you should be able to run the command?ls

Next you will want to run?

nano?sshd_config

From here you will want to use ctrl+w and enter the phrase?

port

From here you will need to delete the # symbol to uncomment the line. Next you will change the 22 to any port you wish under 65535.?

?

For compatibility please do not use the following ports
25
110
443
495
21
80
2083
2082
2086
2087
2096
9876

If you wish to confirm the port you have chosen is a safe port to use simply contact support or submit a support ticket. We can not make a recommendation for a port.?


Finally restart SSHD with?

service sshd restart



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read