Advertisements

Tag Archives: mknod

-bash: /dev/null: Permission denied

After login I received a message showing permission problem on /dev/null

-bash: /dev/null: Permission denied
-bash: /dev/null: Permission denied
-bash: /dev/null: Permission denied
-bash: /dev/null: Permission denied
-bash: /dev/null: Permission denied
-bash: /dev/null: Permission denied

On a working server, it is a character device with rw permissions

root@workinglinux:~ # ls -l /dev/null
crw-rw-rw- 1 root root 1, 3 Jul 21 15:56 /dev/null

root@linux:~ # ls -l /dev/null
-rw-r–r– 1 root root 0 Jul 25 13:11 /dev/null

Remove the file and recreate it

root@linux:~ # rm -f /dev/null
root@linux:~ # mknod -m 666 /dev/null c 1 3

root@linux:~ # ls -l /dev/null
crw-rw-rw- 1 root root 1, 3 Jul 25 13:13 /dev/null

Advertisements
%d bloggers like this: