Need user access to /dev/parport0 , how ?

Larry Grover lgrover at zoominternet.net
Sat Sep 3 15:30:08 UTC 2005


Vincent Trouilliez wrote:
> Hi,
> 
> 
> I have got a programme that uses the parallel port of the machine.
> I added the module ppdev in /etc/modules so that the /dev/parport0
> device  gets created at boot so that the program can access the port.
> However I have to run the program as root in order to use
> the /dev/parport0, not very practical.
> How can I (permanently ie) allow user access to this device ?
> 
> I would modify the permissions on the file, but since the device needs
> to be created at every boot, I also assume that it gets deleted at every
> power-off, and the user permissions with it sadly !
> 
> Is there a way ? Or will I have no choice but DIY and add a "chmod
> something /dev/parport0" in some start-up script in /etc/init.d ???


No, I don't think you need to hack your start-up scripts.

One option is to check the ownership/permissions on the device:
ls -l /dev/parport0
and add your user to the group which owns parport0.  This should work, 
assuming the group has read/write permissions on the device (the "ls" 
command will tell you this).

A second option (I think) would be to modify the udev rules.  I'm 
really not familiar with this, but I believe the correct way is to 
edit the /etc/udev/udev.rules file.  You could relax the permissions 
for the parport0 device or else change the ownership so that the 
device is owned by a group to which your user already belongs.

Regards,
Larry




More information about the ubuntu-users mailing list