/dev/null - Why is it read/write proteced ?

Asked by Sascha Mantscheff

On a fresh ubuntu system I wanted to add a crontab for a user (with crontab -e, which calls the editor joe) and got the message:
  /dev/null: Permission denied
because /dev/null had the permissions
  crw------- 1 root root 1, 3 Aug 12 16:12 /dev/null
After changing the file mode to crw-rw-rw- all went smoothly.
Is there a good reason to deny all non-root users read/write access to /dev/null ?

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Ian Ace (iaculallad) said :
#1

Try issuing the command below on your Terminal to fix the /dev/null problem:

Run it as root:

sudo su
mknod -m 666 /dev/null c 1 3
chown root.mem /dev/null

HTH.

Revision history for this message
smantscheff (sascha-mantscheff) said :
#2

Hello Ian Ace,
thank you for being helpful, but that was not my question.
The question is: is there a good reason for Ubuntu to deny r/w access to /dev/null to all other than root? Is this a security issue?

Can you help with this problem?

Provide an answer of your own, or ask Sascha Mantscheff for more information if necessary.

To post a message you must log in.