Phone : 00212625597419
Knowledgebase

How to Change or Reset SSH port

A. Change SSH port number:

Open sshd_config
pico /etc/ssh/sshd_config

Find:
#Port 22

Change to new port and remove #
Port 2950

Restart SSH:
service sshd restart

Don’t close your current SSH session
Start a new SSH session in a new widows with the new SSH port
If you are able to login using new SSH port number, you have successfully changed your server SSH port number.

You can verify if the configuration has been applied with the following command:
netstat -tulpn | grep sshd

B. Reset SSH port number:

Login in to WHM:
https://IP:2087

Add following url at the end of WHM url:
scripts2/doautofixer?autofix=safesshrestart

Final url will be:
https://IP:2087/scripts2/doautofixer?autofix=safesshrestart

Your server SSH port is now reset to default 22.

If its not working, you may need to restart SSH from
WHM >> Restart Services >> SSH Server


استضافة الناصح


Was this answer helpful?

Add to Favourites Add to Favourites

Print this Article Print this Article

Also Read

Language: