By default on Linux servers SSH runs on 22 port. We can change the default SSH port for Linux server as an added security measure.
NOTE: Before changing the SSH port makes sure the new SSH port does not conflict with any known, used or blocked ports.
To change the SSH port on your Linux server follow the below steps:
1. Connect to server as the root user or switch the user root using the following command:
3. Open the sshd_config file in your favorite text editor:
4. Find the following line
5. Change 22 to your desired port number. For example:
6. Save the changes andrestart ssh services
service sshd restart