Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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.)

share|improve this question

1 Answer 1

up vote 4 down vote accepted

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.

share|improve this answer

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.