More Technical Help

Sunday, March 6, 2011

How to Change SSH port on cPanel Server

As far as security concern its a good deal to change the SSH port of your server, simply you need to follow the steps:

1) SSH to the server with root login

2) You need to make sure that the port you are going to assgin is opened at firwall (in case of CSF, APF):

CSF :
#pico /etc/csf/csf.conf

search for the line : TCP_IN

add the port

APF:
#pico /etc/apf/apf.conf

search for the line : TCP_IN

add the port
3) Now save the changes .

4) You need to change the ssh port in sshd_config File

# pico /etc/ssh/sshd_config
search for Port 22

Uncommnet the line and replace the port and save the file

5) Now it needs to restart ssh service

#/etc/init.d/sshd restart

Note :  Dont close your current ssh seesion until you confirm that you are able to login to the server wtih new port in another ssh session.


Thast's

0 comments:

Post a Comment