1

I'm trying to set the ACLs for a particular file, but using the options

  • R for recursive
  • d for default
  • m for modify

does not seem to have any effect, as indicated below:

/home/pkaramol/Desktop/somedir
$ getfacl afile 
# file: afile
# owner: pkaramol
# group: pkaramol
user::rw-
group::rw-
other::---  


/home/pkaramol/Desktop/somedir
$ sudo setfacl -Rdm u:bullwinkle:rwx afile 


/home/pkaramol/Desktop/somedir
$ getfacl afile 
# file: afile
# owner: pkaramol
# group: pkaramol
user::rw-
group::rw-
other::---
  • 1
    What are you expecting to happen with your setfacl -Rdm command to a file? How would a recursive apply to a file? That's meant for directory trees. – slm Sep 3 '18 at 16:41
3

The use of -Rd really only makes sense when dealing with directories. To modify the ACLs for a given file and add another user you merely do this:

$ sudo setfacl -m u:user1:rwx somefile
$ getfacl somefile
# file: somefile
# owner: root
# group: root
user::rw-
user:user1:rwx
group::r--
mask::rwx
other::r--
Per man setfacl page:
-R, --recursive
       Apply operations to all files and directories recursively. This 
       option cannot be mixed with `--restore'.

-d, --default
       All operations apply to the Default ACL. Regular ACL entries in the 
       input set are promoted to Default ACL entries. Default ACL entries in 
       the input set  are  discarded.  (A  warning  is issued if that 
       happens).

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.