how to reset ssh port from whm

Discussions related with hosting control panels used, which include cPanel, Plesk, Directadmin etc..

Moderator: Staff

Post Reply
Posts: 0
Joined: Fri Sep 16, 2016 10:10 am

how to reset ssh port from whm

Post by Ashlin »


I have locked myself out of a cPanel server due to a mistaken change in SSHD config file. Is there a way to get default config file back without SSH access?

Posts: 0
Joined: Sat Apr 14, 2018 4:21 pm

Re: how to reset ssh port from whm

Post by shaan »

Hi Ashlin,

If you have WHM access as root user, then you can use cPanel Auto fixer script to reset the SSH port.

> Log into WHM as the root user.

> Access the following URL to your SSH configuration settings to default:


Replace “serverip” with your server’s IP address or hostname, whatever you are using to access the WHM panel.

Once the above script is executed, the port number of your SSH server will be reset to its default value 22.

If port 22 is already in use for any other service then, another port will be opened for SSH and it will be displayed in the screen where you are executing the script.

Shaan N
Linux Support Engineer.
Nixtree Solutions
Managed Full Server Backups
Follow us on :

If you are looking for assistance in server management, please get in touch with our support.
Post Reply