Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
1  
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
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.