Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
In your /etc/group you have lp:x:7: line. You might need to add the username so it belongs to the lp group. For example: lp:x:7:username or using sudo useradd -G lp username – val0x00ff Mar 16 '13 at 14:03
You mean adding lp as a secondary group of www-data... that's true, I didn't realize that. It worked perfectly fine, thank you so much.... – Hola Soy Edu Feliz Navidad Mar 16 '13 at 14:15
Glad it worked! – val0x00ff Mar 16 '13 at 14:21

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

And an example of someone controlling the ownership of a USB device on Ubuntu:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.