5

Can a directory belong to more than one group?

(On windows it seems possible - but when I do an ls - it looks like there is only one group available.)

6

If your filesystem supports posix acl extensions, then yes you can have more than one group. Most normal unix/linux tools and programs wont show you more than the default user:group:other stuff.

Use getfacl <file/dir> to get current acl settings and setfacl to set them.

$ getfacl .
# file: .
# owner: root
# group: src
user::rwx
group::r-x
mask::rwx
other::---

 # only user root got write access and src group read/exec access
$setfacl -m g:root:rwx .
$setfacl -m g:staff:rwx .
 # and now root and staff groups have full write access

$ getfacl .
# file: .
# owner: root
# group: src
user::rwx
group::r-x
group:root:rwx
group:staff:rwx
mask::rwx
other::---

See man mount for mount options

  ext2:
  acl|noacl
          Support POSIX Access Control Lists (or not).

See man getfacl and man setfacl for acl examples and options.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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