Wednesday, December 10, 2014

What will do if openssh demon not started?

If we face an issue with ssh demon as,

#/etc/init.d/sshd start --showing as service started
But

#/etc/init.d/sshd status --showing status as service is not running .

Ex:

-bash-3.2# /etc/init.d/sshd start
Starting sshd: [ OK ]
-bash-3.2# /etc/init.d/sshd status
openssh-daemon is stopped

We can found an error as below in /var/log/secure,

#vps sshd[18431]: fatal: daemon() failed: No such device

The reason for this is ,its related to /dev/null which is suppossed to be
a proper character device and not a regular file.

In this case we can move it or remove it and then recreate file as below,

-bash-3.2# rm -f /dev/null
-bash-3.2# mknod /dev/null c 1 3
Once character device is created ,permission is like below,

-bash-3.2# ls -lh /dev/null
crw-rw-rw- 1 root root 1, 3 Jan 12 16:07 /dev/null
-bash-3.2#

fter this was confirmed that /dev/null is a proper character device , and
the sshd service will start now,

-bash-3.2# /etc/init.d/sshd start
Starting sshd: [ OK ]
-bash-3.2# /etc/init.d/sshd status
openssh-daemon (pid 27662) is running...
-bash-3.2#

No comments:

Post a Comment