Changed SSHD port to 22222 - SSHD Down - Can recover from WHM Panel

xbank

Registered
Jun 25, 2011
1
0
51
Hello,

I was trying to secure my sshd and changed the port to 22222 instead of 22444 .. restarted the sshd and boom.

I tried restarting from WHM but useless as because I changed the port and restarted the sshd daemon.

Is there a way I can fix it from WHM .. I have a latest Cpanel


Thanking You!
Xbank
 

Kristian0911

Member
Jan 17, 2011
22
0
51
Hello,

I was trying to secure my sshd and changed the port to 22222 instead of 22444 .. restarted the sshd and boom.

I tried restarting from WHM but useless as because I changed the port and restarted the sshd daemon.

Is there a way I can fix it from WHM .. I have a latest Cpanel


Thanking You!
Xbank
If you are able to access the server, you will need to login to server with SSH and edit the ssh config file.

vi /etc/ssh/sshd_config

change the Port number to 22 or which ever you want.

OR ask your server provider to change it to default port. They should help you with the issue.

Thanks :)
 

adminlogs

Member
May 30, 2011
5
0
51
Hi ,

Regarding ,

>>>> Is there a way I can fix it from WHM

Log in to WHM as root user and browse following URL.

/http://192.168.0.100:2086/scripts2/autofixer

Use your server ip instead of 192.168.0.100 in above URL. To reset the sshd_config file insert "safesshrestart" in autofixer window

The above will reset your ssh port to the default one 22. Once the above script execution is over then you can login to the server using port 22 and change the port as you like.

Sincerely,
 

astopy

Well-Known Member
Apr 3, 2003
166
0
166
cPanel Access Level
Root Administrator
When you restart sshd it doesn't close existing connections, so next time check that you're able to open a new connection *before* logging out.

If your host gives you remote console access you'll be able to log into that to fix it.