How to change ssh-port when transferring accounts


Well-Known Member
Feb 14, 2005
My server were secured few days ago and the ssh port were changed to something else than 22. Now if I try to use WHM function to copy accounts from other servers, it wont work because WHM tries to connect to port 22.

How can I change this port to something else?


Well-Known Member
Nov 3, 2007
Here is the steps to change SSH port which works fine for me

To change the SSH port number login as root, and edit /etc/ssh/sshd_config

Find the line that says Port 22 and change 22 to any number between 1024->65535 (above 30000 is best) and save the file.

Once done, run:

/etc/init.d/sshd restart

Now start a new SSH session (don’t close your existing one), to make sure that you can get in.

And as per cPtechie the new port must be opened in the firewall e.g CSF firewall


Quality Assurance Analyst
Staff member
Oct 2, 2010
somewhere over the rainbow
cPanel Access Level
Root Administrator
Hello petfut,

Given your question mentions having already changed the SSH port and asking how to get WHM transfer accounts to recognize the port as one *other* than 22, I imagine you would like steps on how to properly transfer rather than how to change the SSH port, since that appears to already have been done.

If you use WHM > Transfers > Copy an account from another server or WHM > Transfers > Copy multiple accounts/packages from another server options, you have the following field that you can change from port 22 to the new SSH port:

Remote SSH port:
You do not have the option to change the port if you use WHM > Transfers > Copy an account from another server with account password area.