Page 1 of 1

how to reset ssh port from whm

Posted: Wed Sep 06, 2017 9:56 am
by Ashlin
Hi,

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?

Re: how to reset ssh port from whm

Posted: Sat Apr 14, 2018 5:15 pm
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:

http://serverip:2086/scripts2/doautofixer?autofix=safesshrestart

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
https://www.nixtree.com/managed-backups.php
Follow us on : https://twitter.com/nixtree