Linux Question

I am trying to do permissions to a folder for multiple groups, each will have different permissions to the directory. Can you let me know how to do this without using ACL's?

Group 1 RW
Group 2 R
Group 3 RWX

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

On ubuntu if you want to restrict access to only two groups say Group01 full access and Group02 having only read only access, In this case you can use file access control list (ACL). (In your case I think itis the best solution)

setfacl -R -m g:Group01:rwx Folder01
setfacl -R -m g:Group02:r-- Folder01
You can verify changes via getfacl Folder01.And you can remove all permissions for others like this chmod -R o-rwx Folder01

So by this your folder is only accessible via Group01 ( full access ) and Group02 (read only access) and no doubt owner of that folder can also access that folder.
Jack_son_Author Commented:
That is good, although can you do this without using an acl?
As far as I know it that is that only way. You can make a directory belong to multiple groups by mounting the relevant partition with POSIX Access Control Lists (ACL) activated.

The programs to work with ACLs, once the file system is mounted to support them, are getfacl and setfacl:

You might find this very useful:
and this:
>how to do this without using ACL's?

Not possible in standard Linux/ext-fs (afaik). You'll need ACL or use another system (like Microsoft AD/Samba).

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.