Page 1 of 1

/dev node permissions

Posted: Wed Mar 06, 2013 12:04 am
by Lumpynose
I'm waiting for my pi. From reading the tutorials and books on doing i/o on the pi I'm getting the impression that linux makes entries in /dev on the fly, which is nice, but they're owned by someone other than the pi user. Is there a way to have linux make the /dev entries world writable or owned by pi?

Re: /dev node permissions

Posted: Wed Mar 06, 2013 12:07 am
by redhawk
I don't think that's possible you still need to be a superuser ie. root to tinker around with hardware like GPIO pins.

Richard S.

Re: /dev node permissions

Posted: Wed Mar 06, 2013 12:18 am
by jojopi
The device permissions are set by the "udev" subsystem and yes, if you need to, you can add custom rules to adjust them.

However, by default most devices are owned by root but also read/writeable by a group such as audio, video, input, dialout, cdrom. So you only need to ensure that users who should have access are members of the relevant groups. In the foundation's raspbian images, the "pi" user is already a member of all the above.

Re: /dev node permissions

Posted: Wed Mar 06, 2013 12:31 am
by Lumpynose
Thanks jojopi. So why do I see all of these examples always running i/o programs with sudo?

Re: /dev node permissions

Posted: Mon Mar 11, 2013 4:08 pm
by DBryant
Why? Because folk find it easier to run as the superuser and hope it will works rather than find the correct way of doing stuff. Basic human nature.