You have required sudo or root user to do this activity.

1. You need to access your server using ssh with putty or terminal.

2. Click on open and enter the password of root user.

3. Open the ssh configuration file using below command in your favorite file editor.

[[email protected] ~]# vi /etc/ssh/sshd_config 

4. Enter the port which we you wan tot set. In our case we are using 9761. You need to add line on below line #port 22 for eg:-

5. Save and exit the file and restart the ssh server using the command below.

[[email protected] ~]# systemctl restart sshd 

SSH default port change process is done. Now you can access your using ssh on custom port which you have set.