How to reset SSH port from WHM?

All of us know about the default SSH port number on a Linux server. Yeah, here in WHM, no change in the default SSH server. The default port number is 22. We can change the port number by editing the SSH configuration file via server command line interface.

Consider the scenario, you changed the port to a non default value and you just forgot it!! Lol. You can’t access the server shell anymore.

However, you are able to access the WHM panel without SSH details. Say thanks to cPanel developers, yeah, there is an option to reset the SSH port to the default value from the WHM interface.

There is an Auto fixer script available to reset the SSH port,once you have the details (root details) to WHM control panel.

Please do followup the steps pasted below to reset the SSH port from web browser.

Step 1 : Log into WHM control panel as root user.

Step 2 : Then, access the following URL to reset 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.

After executing this script, the port number of your SSH server will be reset to its default value 22. Now, you can log into your server through the port 22 and reset the configuration.

Access Linux Shell From Windows Machine Using Putty

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.

🙂 Enjoy!! Happy hosting!!

Also read : Change SSH port of a server having Webmin

Arunlal Ashok

Sr. Linux Server Administrator. I'm managing Linux servers since 2012. I started this blog to share and discuss my ideas. Check My Profile in uPwork (oDesk) and create a job, if you need any administration help. Thanks!!

You may also like...

5 Responses

  1. Claudio says:

    Thank you very much. I have been looking for this solution for days!!!!! I am moving VPS to another company and the transfer tool will not work if the ports were not the same, after I applied your fix: http://yourserverip:2086/scripts2/doautofixer?autofix=safesshrestart worked perfectly!!!!!!! Thank you again!!

  2. Taha Kazi says:

    Thanks a lot… My SSH was not working… miraculously this fixed the issue…

  1. January 3, 2014

    […] refer: How to reset SSH port from WHM How to change cpanel port through command line How to change the apache port via command line in […]

Leave a Reply

Your email address will not be published. Required fields are marked *