1

I have a USB printer that when I connect to the computer it's owned by the user root and the group lp, and it's file permission is rw-rw----, so I have to print via apache/php script. To solve this problem I change the file group or the files permision but the problem is that when the printer is reconnected it loses it's files owners and permission being again the lp its group and rw-rw---- the files permision.

How can I set it's files owner or permission "forever"?

Thank you.

P.D. I use Ubuntu server 12.04.

1 Answers1

2

Ownership is controlled by the udev rule which matches the device. Most distributions, including Ubuntu, add rules for new devices in order to make sure the device gets back the same name in the future, it should be a straightforward edit to add an OWNER= option to that rule.

More information at http://www.reactivated.net/writing_udev_rules.html#ownership

And an example of someone controlling the ownership of a USB device on Ubuntu: https://askubuntu.com/questions/185403/udev-rule-group-ownership-not-working

Ben Voigt
  • 473
  • 5
  • 20