Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
2  
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
add comment

1 Answer

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: http://askubuntu.com/questions/185403/udev-rule-group-ownership-not-working

share|improve this answer
add comment

Your Answer

 
discard

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.