I have looked though the answers to similar questions and refreshed my memory on ACLs by reading tutorials on Linux ACLs. Yet, I am still stumped. What have I done wrong, or what do I not understand?I have a file system mounted with the acl option.user@host:/srv$ grep srv /etc/fstabUUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx /srv ext4 relatime,nodev,nosuid,user_xattr,acl 0 2The user, user, is a member of the devs group.user@host:/srv$ iduid=1000(user) gid=1000(user) groups=1000(user),24(cdrom),25(floppy),27(sudo),29(audio),30(dip),44(video),46(plugdev),1001(devs)The umask is normal.user@host:/srv$ umask0022A directory is created; group ownership and permissions are set.user@host:/srv$ sudo mkdir lib; sudo chmod 0750 lib && sudo chgrp www-data libuser@host:/srv$ ls -ltotal 24drwxr-x---  2 root www-data  4096 May 21 18:00 libdrwx------  2 root root     16384 Feb 17 18:22 lost+founddrwxr-xr-x  3 root www-data  4096 May 21 17:25 wwwAn ACL is applied to the new directory.user@host:/srv$ sudo setfacl -d -m g:devs:5 lib/user@host:/srv$ getfacl lib# file: lib# owner: root# group: www-datauser::rwxgroup::r-xother::---default:user::rwxdefault:group::r-xdefault:group:devs:r-xdefault:mask::r-xdefault:other::---I think I should be able to get a directory listing, but I cannot.user@host:/srv$ ls lib/ls: cannot open directory lib/: Permission denied
Using ACL with Multiple Default Groups
linux;acl
Gah - facepalm! The -d switch is used for new files and directories within the lib directory. An explicit ACL must be defined for the lib directory itself.Remove the ACLs.user@host:/srv$ sudo setfacl -b libuser@host:/srv$ ls -ltotal 24drwxr-x---  2 root www-data  4096 May 21 19:06 libdrwx------  2 root root     16384 Feb 17 18:22 lost+founddrwxr-x---  3 root www-data  4096 May 21 17:25 wwwSet the default ACL.user@host:/srv$ sudo setfacl -d -m g:devs:5 lib/user@host:/srv$ getfacl lib# file: lib# owner: root# group: www-datauser::rwxgroup::r-xother::---default:user::rwxdefault:group::r-xdefault:group:devs:r-xdefault:mask::r-xdefault:other::---Test if the ACL allows members of the devs group to use ls.user@host:/srv$ ls lib/ls: cannot open directory lib/: Permission deniedAdd a new ACL for the directory, without the -d (default) switch.user@host:/srv$ sudo setfacl -m g:devs:5 lib/user@host:/srv$ ls lib/user@host:/srv$ ls -l lib/total 0Copy a file into the lib directory.user@host:/srv$ sudo cp /etc/hostname lib/user@host:/srv$ cat lib/hostnamehostShow the permissions.user@host:/srv$ ls -l lib/total 4-rw-r-----+ 1 root root 6 May 21 19:15 hostnameShow the ACLs.user@host:/srv$ getfacl lib/hostname# file: lib/hostname# owner: root# group: rootuser::rw-group::r-x                      #effective:r--group:devs:r-x                  #effective:r--mask::r--other::---I am happy to receive any further insight about this.