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.
3. Edit the sshd_config file in any editor. we are using vim editor.
4. Remove the # symbol from sshd_config file to change SSH port number.
5. Now retsrta sshd service.
NOTE: Your port number should be enabled in server firewall too.
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
Code:
# vim /etc/ssh/sshd_config file
5. Now retsrta sshd service.
Code:
# restart service sshd