How to change SSH port for your cPanel server

Rate: 1 Star Rate: 2 Stars Rate: 3 Stars Rate: 4 Stars Rate: 5 Stars

Love it / Hate it

Comments + Likes

How to change SSH port for your cPanel server

Programming / cPanel x

How to change SSH port for your cPanel server

This tutorial will take you through the steps to change the SSH port on your cPanel server. Changing the port on your cPanel server for SSH is a security measure to stop people directly connecting. They would instead have to perform a port scan which would result in a ban. cPanel change SSH Port
How to change SSH port for your cPanel server was posted by Declan and has had 378 view(s) with an overall rating of 5
Posted by Declan


This Tutorial has had 378 Views

To change the ssh port of your server you first must have root access and shell access to the server. To start of we open the desired port in your firewall. For this example we will use port 12345. In our firewall configuration file we will add port 12345 to the allow list using the protocol TCP. Now we change the port for SSH:
Step 1: Open the SSH configuration file using your text editor. If we use the program pico we can edit this by typing

pico /etc/ssh/sshd_config


You should see the following text. Where we see Port 22 we change this to our desired port 12345

Port 12345
#Protocol 2,1
Protocol 2
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::


Use the arrow keys to move to the end of the first line and replace 22. Once this is one press CTRL + X then Press Enter. Now we need to restart the SSH daemon so we enter the command:

/sbin/service sshd restart


Now we go back into our firewall and close port 22 as SSH will not listen on that port.

created on 14/12/2009 @ 16:38, last updated on 30/05/2010 @ 16:00
aProject.info Twitter RSS

  Copyright PHPTutorials.co © 2009 - 2010