If you want to change default SSH ( Secure Shell ) Port, so you need to access your server as root user.
Default port of SSH is 22 but you can change is by editing SSH configuration file /etc/ssh/sshd_config

1.Login to your server via SSH

2. Run nano /etc/ssh/sshd_config

3. Default SSH port appear like #Port 22

4. You need to remove symbol # and replace 22 to with your own custom port.

5. Now restart SSH service service sshd restart 

 

Note:- Don’t forget to add your custom port in server firewall.