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

,

Post navigation

Arunlal A

Senior System Developer at Zeta. Linux lover. Traveller. Let's connect! Whether you're a seasoned DevOps pro or just starting your journey, I'm always eager to engage with like-minded individuals. Follow my blog for regular updates, connect on social media, and let's embark on this DevOps adventure together! Happy coding and deploying!

7 thoughts on “How to reset SSH port from WHM?

Leave a Reply

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