I have a directory in /media/project where I would like to share some stuff with other users. They should also be able to read, write and execute files in that path as well.

Are you able to give default permissions in that particular path when someone creates a new file/directory?

For example if I create a file called test, it would automatically have me as an owner and all the permissions, but also all the permissions for a certain group as well (let's say I have used chown -R user:usergroup /media/project before this) and no permissions for others. Also if someone from that usergoup creates a file they will have same permissions as well.

How am I able to achieve this? I don't think umask is the solution since it takes affect everywhere and I want the rule to apply in this path only.

I know this could be achieved using chmod on the root of this directory, but it seems kind of redundant to do that everytime someone makes a new file.

EDIT: I noticed there is a solution to a similar question in this link Link to similar question I can´t comment there yet since I have not enough reputation points.

However I could not find a solution for making the files & folders executable as default. I have made an example somedir-folder: setfacl -Rd -m u:user:rwx,g:usergroup:rwx,o::r somedir

After this I create a file: touch somedir/afile

and it has the wrong kind of permissions:

-rw-rw-r--+ 1 user usergroup 0 Dec 2 15:57 afile

How do you get the execution permission as default for the group and the user?

  • If you set ACLs you cannot simply check them with the standard unix permissions (which you get from ls -l). Use getfacl <file> instead.
    – FelixJN
    Dec 2, 2019 at 15:24


Browse other questions tagged .