Image may be NSFW.
Clik here to view.
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 ?
Image may be NSFW.
Clik here to view.
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.
Check more discussion of this question.