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 !!!
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 !!!
4 comments:
punk
Checked /dev/null is already character file still sshd daemon failing
Not working for me
root@lvdevvordkfe1 ~]# rm -f /dev/null
[root@lvdevvordkfe1 ~]# mknod /dev/null c 1 3
[root@lvdevvordkfe1 ~]# ls -lh /dev/null
crw-r--r-- 1 root root 1, 3 Mar 28 16:04 /dev/null
[root@lvdevvordkfe1 ~]# /etc/init.d/sshd start
Starting sshd: [ OK ]
[root@lvdevvordkfe1 ~]# /etc/init.d/sshd status
openssh-daemon is stopped
[root@lvdevvordkfe1 ~]#
that is solve your problem:
chmod 666 /dev/null
Post a Comment