1

This question already has an answer here:

I cannot enter a directory after creation in a folder with an ACL: I am attempting to limit rwx access to a folder for just a single group and no one else. I would like to be able to add new users to a group and have them gain access to a directory.

This is what I have done so far

  1. mkdir /mnt/files
  2. cp /media/usb0/backup/* /mnt/files
  3. chgrp filers /mnt/files
  4. chmod -R g+s /mnt/files
  5. setfacl -b /mnt/files # to remove user and other
  6. setfacl -R -d -m g:filers:rwx /mnt/files
  7. getfacl /mnt/files

    # file: mnt/files/
    # owner: root
    # group: filers
    user::---
    group::rwx
    other::---
    default:user::---
    default:group::rwx
    default:group:filers:rwx
    default:mask::rwx
    default:other::---
    

So far everything looks good . . .

  1. cd /mnt/files
  2. mkdir test
  3. ls -l

    d---rws---+ 2 jimmy filers 4096 Nov 28 14:32 test
    
  4. cd test

    -bash: cd: test/: Permission denied
    

Any reason I can't enter the folder I just created?

  1. getfacl ./test

    # file: test
    # owner: jimmy
    # group: filers
    # flags: -s-
     user::---
     group::rwx
     group:filers:rwx
      mask::rwx
     other::---
     default:user::---
     default:group::rwx
     default:group:filers:rwx
     default:mask::rwx
     default:other::---
    

marked as duplicate by Gilles, jimmij, jasonwryan, Anthon, Braiam Nov 30 '14 at 1:29

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2

Any particular reason why owner doesn't have full permissions? Owner's permissions take precedence. As a root, you can do anything, but as a regular user if you remove rwx for a directory you own, you cannot enter it since you don't have a search bit (x). It does not matter that you are in a group that have permissions. Right know, user jimmy cannot enter his directory, but paradoxically just about any other user in a group filers can. I'd say step 6 should be setfacl -R -d -m u::rwx,g:filers:rwx /mnt/files

  • This fixed it, I was unaware that not having X on user superseded the x in the group. Why wouldn't execute permissions in group work for a folder assigned to that group? Either way knowing that the user must have individual permissions fixed my issue. I went with: setfacl -R -d -m u::--x,g::rwx /mnt/files – omgimdrunk Nov 29 '14 at 1:58
  • I would up-vote this but apparently I don't have enough internet karma to donate karma, I apologize but thank you non-the-less – omgimdrunk Nov 29 '14 at 1:59
  • @omgimdrunk you are welcome. I believe you can still accept my answer if you wish: i.stack.imgur.com/QpogP.png – Miroslav Franc Nov 29 '14 at 2:09

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