1

my directory hierarchy looks like this

/tmp/
    dir/
       subdir/
       file   

so i try command (found on a similar issue linux/setfacl - Set all current/future files/directories in parent directory to 775 with specified owner/group)

setfacl -Rm u::rwX,d:u::rwX tmp/
setfacl -Rdm u::rwX,d:u::rwX tmp/

it works fine, all file and directories are affected, but when i add a new file

/tmp/
    dir/
       subdir/
       file 
       file2  

it doesnt affect file2, i also tried with small x

setfacl -Rm u::rwx,d:u::rwx tmp/
setfacl -Rdm u::rwx,d:u::rwx tmp/

but it doesn't work, can anyone please tell me what i'm doing wrong

LaHwF Sk
  • 11
  • 3
  • We need to see the desired vs. actual ACLs on `file2`. Can we see contrasting `getfacl` on `file` and `file2`? – BaseZen Jun 04 '21 at 16:39
  • file1 goes as planned but file2 gets default permissions – LaHwF Sk Jun 06 '21 at 22:05
  • I believe the `umask` figures in to new files even when ACLs are used. Check in with https://askubuntu.com/questions/44542/what-is-umask-and-how-does-it-work – BaseZen Jun 07 '21 at 15:38
  • I don't see the point of using ACLs if there aren't at least two users or groups involved. I can't see any specific user or group mentioned in the question. – A.B Jun 07 '21 at 15:40
  • the user is not the issue i can add a user if it's necessary, i want to give the premissions to files added automatically – LaHwF Sk Jun 07 '21 at 15:59

1 Answers1

0

As you are telling us, when you apply an ACL permissions, you only apply to this changes to the existing path and files, but if you create a new file, the user isn’t allowed to read, write or execute it.

You have two options, change all the permissions for the path recursively, or add as a default user with ACLs, this change will add the user to the list and all the files created will have the permissions executed on the command.

setfacl -d -m u::rwx tmp/

Please consider if you want all the users to have these permissions, I think the best option would be to change it with the command chmod

Kyle
  • 1,589
  • 9
  • 14