How to change SSH port on VPS server?

bhawanisingh

Administrator
Staff member
You should change the SSH port on VPS server to add extra layer of security.
You have to follow below steps to change port:
1. Login to your server with SSH
2. For safety, take backup of your /etc/ssh/sshd_config file with this command.
Code:
# cp /etc/ssh/sshd_config /etc/ssh/sshd_config_backup
3. Edit the sshd_config file in any editor. we are using vim editor.
Code:
# vim /etc/ssh/sshd_config file
4. Remove the # symbol from sshd_config file to change SSH port number.
5. Now retsrta sshd service.
Code:
# restart service sshd
NOTE: Your port number should be enabled in server firewall too.
 
Top