Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Added subdirectory flag to acls.

...

Code Block
languagebash
sudo /home/
# Normal permissions
sudo chown -R svradm:svradm ./www.dailyplanet.com/
sudo chmod -R 750 ./www.dailyplanet.com/
# ACL permissions
sudo setfacl -mRm g:wgdailyplanet:rwx ./www.dailyplanet.com/
sudo setfacl -mRm g:www-data:r ./www.dailyplanet.com/
sudo setfacl -mRm g:staff:r ./www.dailyplanet.com/

...

Code Block
languagebash
getfacl --access ./www.dailyplanet.com/ | sudo setfacl -d -MRM - ./www.dailyplanet.com/
getfacl --access ./www.lexcorp.com/ | setfacl -d -M- ./www.lexcorp.com/

getfacl --access generates the details of the permissions we applied to the directory and the setfacl with the -d and -M parameters changes the default ACL for new files and directories. The R flag esures the changes are applied recursively to folders and files.

Info

Notice the dash after -M which takes as a parameter file. If the file is -, the input is taken from stdin.

Repeat the same steps for www.lexcorp.com and change the group accordingly,

Code Block
languagebash
sudo /home/
# Normal permissions
sudo chown -R svradm:svradm ./www.lexcorp.com/
sudo chmod -R 750 ./www.lexcorp.com/
# ACL permissions
sudo setfacl -Rm g:wglexcorp:rwx ./www.lexcorp.com/
sudo setfacl -Rm g:www-data:r ./www.lexcorp.com/
sudo setfacl -Rm g:staff:r ./www.lexcorp.com/
# Apply default ACLs
getfacl --access ./www.lexcorp.com/ | sudo setfacl -d -RM - ./www.lexcorp.com/

Still one problem is that if files exist they have read from other... to fix this... maybe because I did it after, to test again...

References

Good introduction from the Ubuntu docs - https://help.ubuntu.com/community/FilePermissionsACLs

...