3

Can one directory be owned by two groups (RHEL 6.2)?

I have created one directory: mkdir /opt/shared, then I created two groups: groupadd sales groupadd marketing

I added manually to each of these groups 21 users, then I changed the ownership chown root:sales /opt/shared and chown root:marketing /opt/shared.

Then I changed the unmask chmod 2775 /opt/shared

The problem is, only group marketing have permission to rwx.

Gilles 'SO- stop being evil'
  • 807,993
  • 194
  • 1,674
  • 2,175
B.L
  • 33
  • 1
  • 3
  • 1
    Related to many Q&A's on the site. Here's one for starters: [How to add a read only group permission to a folder that already has a default group, and have it inherited for all newly created files & folders?](http://unix.stackexchange.com/questions/127489/how-to-add-a-read-only-group-permission-to-a-folder-that-already-has-a-default-g/127495#127495) – slm May 04 '14 at 23:21

1 Answers1

2

A directory (like everything else) can only have one group (the "ACL_GROUP_OBJ" in ACL terminology). But via ACL (setfacl) you can define permissions for other groups, too. Even (via default ACLs) for newly created objects in the directory.

Hauke Laging
  • 88,146
  • 18
  • 125
  • 174