How To change SSH Port using WHM or CSF

Knowledgebase Articles and news

Views
738
Useful
0
By
Admin

How To change SSH Port using WHM or CSF

If your are using WHM and CSD with CentOS then you should follow these steps to change SSH port 22 (default) to any other port which you want.

1. Edit the file sshd_config as mention below

/etc/ssh/sshd_config

You can use vi

vi /etc/ssh/sshd_config

2. Find this line

#Port 22

Change to your chosen port, and remove the comment ( # sign )

Port 9999

3. Restart the SSH service.

service sshd reload

4.  Now we must allow incoming data in the new port. Open your WHM >> Plugins >> CSF.
5.  Click “Firewall Configuration” button.
6.  Add your new port in “TCP_IN” and “TCP_OUT”.
7.  Click “Change” button in the bottom of the page.
8.  You will be asked to restart CSF & LFD. Do it.
9.  It’s done.