Showing posts with label sshd. Show all posts
Showing posts with label sshd. Show all posts

Tuesday, July 16, 2013

Safe SSH restart cPanel

If you can access WHM/cPanel of the server and cant SSH into the server you can try this method.


# Restart SSH Deamon in Safe Mode using HTTP
http://X.X.X.X:2086/scripts2/autofixer

# Restart SSH Deamon in Safe Mode using HTTPS
https://X.X.X.X:2087/scripts2/autofixer

# type/enter script name
safesshrestart

You can also try this, do to not forget to login to WHM first and then COPY and PASTE this to address bar of your web browser:
# Direct URL for SSH Deamon Restart in Safe Mode using HTTP

http://X.X.X.X:2086/scripts2/doautofixer?autofix=safesshrestart
# Direct URL for SSH Deamon Restart in Safe Mode using HTTPS

https://X.X.X.X:2087/scripts2/doautofixer?autofix=safesshrestart
NOTE: do not forget to replace X.X.X.X with your domain name or server ip address.

When executing this cPanel with kill currently running ssh server and run it with own/default configuration file located at /var/cpanel/safe_sshd
/usr/sbin/sshd -f /var/cpanel/safe_sshd

After this if you restart SSH deamon the SSH will go back to its original settings.

Wednesday, May 9, 2012

openssh-daemon is stopped

I created a new vps node installed with centos. Unfortunatly the sshd service was not starting. I checked the logs /var/log/messages and /var/log/secure but nothing realted to sshd was logged in it.

The service would start but the status was showing stopped as you can see below:

[root@hari ~]# /etc/init.d/sshd start
Starting sshd:                                             [  OK  ]
[root@hari ~]# /etc/init.d/sshd status
openssh-daemon is stopped

After searching across the internel found that /dev/null is a regular file in the node. /dev/null which is suppossed to be a proper character device and not a regular file.

Hence i decided to recreate the same as a charecter device.

[root@hari ~]# rm -f /dev/null
[root@hari ~]# mknod /dev/null c 1 3

After these the permission should look like these.

[root@hari ~]# ls -lh /dev/null
crw-rw-rw- 1 root root 1, 3 May 09 14:23 /dev/null

After praying to god that this should work i started the service again.

[root@hari ~]# /etc/init.d/sshd start
Starting sshd:                                             [  OK  ]
[root@hari ~]# /etc/init.d/sshd status
openssh-daemon (pid  14930) is running...

IT WORKED !!!

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Affiliate Network Reviews