4

I have created a directory and used chown to make my user and group the owner. If I create a new folder inside the parent folder then the permissions for 'others' under the permissions tab is set to 'access files' not 'create and delete files'.

How can I ensure all sub folders and files of my parent folder all default to the parent permissions?

Ubuntu 16.04LTS

/opt/lampp/htdocs directory
1

1 Answer 1

9

Using the setfacl tool you can set this with:

sudo setfacl -R -d -m o::rwx /opt/lampp/htdocs
sudo setfacl -R -m o::rwx /opt/lampp/htdocs

The first line sets this to default, while the second just modifies and leaves the acl ( access control list ) values. The first line is what your looking for.

Info:

  1. -d: default for future subfolders
  2. -m: modify existing acl
  3. -R: make changes recursively
  4. o: set acl for folder others

See man setfacl

2
  • 1
    Thanks the first line worked great, can you just explain the second line a little further, why do I need it? Sep 5, 2017 at 18:30
  • 1
    It does the same as the first only that it just modifies the acl but does not make it the default acl when a new subfolder is created. Sep 5, 2017 at 18:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .