Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I own a particular file on a Linux system. I would like to give 2 groups (accounting, shipping) read access and only read access, and 3 users(Mike, Raj and Wally) write access and only write access.

How can I accomplish this?

share|improve this question
2  
Question for superuser –  Drakosha Jul 8 '10 at 5:48
1  
Sounds more like ServerFault to me--- Multi-user and all. –  Reece45 Jul 8 '10 at 6:14
    
@AlReece45 I disagree. This is specific to linux operating systems and has nothing to do with administering a network so it should remain on Super User. –  Evan Plaice Jul 8 '10 at 6:55
add comment

migrated from stackoverflow.com Jul 8 '10 at 6:18

This question came from our site for professional and enthusiast programmers.

1 Answer

I suggest using POSIX ACLs (Access Control Lists). Your filesystem must support them / have the acl option enabled, but if it does, then your problem simplifies to:

setfacl -m u:mike:w myfile
setfacl -m u:raj:w myfile
setfacl -m u:wally:w myfile
setfacl -m g:accounting:r myfile
setfacl -m g:shipping:r myfile

And you can do that for arbitrary sets of permissions.

share|improve this answer
add comment

Your Answer

 
discard

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