Lumpynose
Posts: 37
Joined: Thu Feb 28, 2013 6:07 am

/dev node permissions

Wed Mar 06, 2013 12:04 am

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?

User avatar
redhawk
Posts: 3465
Joined: Sun Mar 04, 2012 2:13 pm
Location: ::1

Re: /dev node permissions

Wed Mar 06, 2013 12:07 am

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.

User avatar
jojopi
Posts: 3268
Joined: Tue Oct 11, 2011 8:38 pm

Re: /dev node permissions

Wed Mar 06, 2013 12:18 am

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.

Lumpynose
Posts: 37
Joined: Thu Feb 28, 2013 6:07 am

Re: /dev node permissions

Wed Mar 06, 2013 12:31 am

Thanks jojopi. So why do I see all of these examples always running i/o programs with sudo?

DBryant
Posts: 281
Joined: Sat Feb 02, 2013 12:41 pm
Location: Berkshire, UK

Re: /dev node permissions

Mon Mar 11, 2013 4:08 pm

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.

Return to “Advanced users”