Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I accidentally sudo chmod 666 /dev/*. And now many devices in my computer messed up. I have fixed some of them like /dev/shm, /dev/snd but I am not sure about the rest. What's the correct permission for file and folder in /dev/* ? Can I restore it to the default value ?

share|improve this question
Are you using udev? – Ignacio Vazquez-Abrams Jan 17 '13 at 16:55
No I'm not using it, I'm in ubuntu 12.04 – iKid Jan 17 '13 at 16:57
So you stripped udev out of your system? – Ignacio Vazquez-Abrams Jan 17 '13 at 16:58
I guess it's there :) I just do not know about it – iKid Jan 18 '13 at 11:57
up vote 2 down vote accepted

In modern Linux systems, the /dev/ filesystem gets rebuilt at every boot by udev. If you can afford to reboot, you'd best just do that rather than spend the time required to clean up the mess and run the risk of missing something important (which could very well cause a security issue).

If you still want to do it manually, you will find all of the udev rules that specify the permissions that things are supposed to have in /lib/udev/rules.d and /etc/udev/rules.d. Beware, there are lots!

You might be able to get udev to rerun its rules automatically and fix everything up with the following command:

/sbin/udevadm trigger --action=add

...but I have not tried this and I have no idea whether it will actually work or if it will cause problems.

share|improve this answer
Look like everything is reverted after restarting :) thanks – iKid Jan 18 '13 at 11:57

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.