/dev/null permission denied solutions

In one of my VPS, having /dev/null permission denied after every reboot and causing multiple processes that access /dev/null unable to start.

This is due to /dev/null permission was wrong

# ls -l /dev/null
crw------- 1 root root 1, 3 Aug 11 17:21 /dev/null

Cause 1
# egrep -sr "/dev/null" /etc/udev/rules.d/*
The output should be something like this:

KERNEL=="null", MODE="0666"

Change the MODE if it is wrong, restart server to check its permission

Cause 2

# ls -l /lib/udev/devices/null
crw------- 1 root root 1, 3 Aug 11 17:21 /lib/udev/devices/null


# chmod a+rw /lib/udev/devices/null
# ls -l /lib/udev/devices/null
crw-rw-rw- 1 root root 1, 3 Aug 11 17:21 /lib/udev/devices/null

Restart server to check its permission