Thursday, August 22, 2013

/dev/null: Permission denied

Error name: /dev/null: Permission denied 

I got this  error message while  Logging (doing ssh) into  one production server.   Please do the Following things to fix it. It doesn't requires any reboot and it wont effect to production.

testmachine11:~ # ls -ld /dev/null
crw------- 1 root root 1, 3 Apr 22  2012 /dev/null


It is a character file, The permissions should be  666 for this one. So , change the permission to 666. after that you wont see that message. 

testmachine11:~ # chmod 666 /dev/null

testmachine11:~ # ls -ld /dev/null

crw-rw-rw- 1 root root 1, 3 Apr 22  2012 /dev/null

(OR)

You can delete it and recreate the /dev/null file. But first solution is little bit faster.  

To Remove it..

     #rm -f /dev/null

 To create the special file for /dev/null 
      #mknod /dev/null c 1 3


This creates the /dev/null special file that is a special character file with the major device number 1 and the minor device  number 3.

Then start the sshd service

 # /etc/init.d/sshd start

 # /etc/init.d/sshd status