0

As root, after creating a directory /Logs/case1, and setting the ACL to have default group "mygroup" permission as "rwx", any subdirectory created doesn't inherit those permissions

$ mkdir /Logs/case1    
$ setfacl -m g:mygroup:rwx /Logs/case1

here are the ACLs after setting them:

gc@logs:/Logs$ getfacl case1
# file: case1
# owner: root
# group: root
user::rwx
group::r-x
group:mygroup:rwx
mask::rwx
other::r-x

Now as a regular user of the system, I'm supposed to create a sub directory under /Logs/case1

$ mkdir /Logs/case1/12345

gc@logs:/Logs/case1$ ls -lrt
total 4
drwxr-xr-x 2 gc mygroup 4096 Dec  1 00:16 12345

gc@logs:/Logs/case1$ getfacl 12345/
# file: 12345/
# owner: gc
# group: mygroup
user::rwx
group::r-x
other::r-x

Why is this directory "/Logs/case1/12345" not inheriting the parent directory ACL for group "mygroup" - "rwx" ?

Here are the assigned groups to user "root" and "gc"

$ groups root
root : root

$ groups gc
gc : mygroup
1

You set the file ACL for /Logs/case1, but not the default ACL. The file ACL isn't inherited, but the default ACL is. To add a default ACL:

setfacl -m g:mygroup:rwx,d:g:mygroup:rwx /Logs/case1

See setfacl.

3
  • Did you mean setfacl -d -m g:mygroup:rwx /Logs/case1? Because above command is giving error setfacl: Option -m: Invalid argument near character 5 – GC 13 Dec 7 '20 at 9:04
  • The syntax I showed works for me, but your OS (OSX?) may have a different syntax. setfacl -d also works, but requires you to use one command to set the permissions, and a second one to set the default permissions. – Andrew Schulman Dec 7 '20 at 11:36
  • Yes, I had to separate it out. – GC 13 Dec 8 '20 at 2:06

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.