Files
oam/knowledge base/linux/acl.md
2023-07-27 21:11:33 +02:00

857 B

Access Control Lists assignment

Table of contents

  1. TL;DR
  2. Further readings

TL;DR

# Install the tool.
apt install 'acl'
dnf install 'acl'

# Show acls of files.
getfacl 'test/declarations.h'

# Set permissions for users.
setfacl -m 'u:username:rwx' 'test/declarations.h'

# Set permissions for groups.
setfacl -m "g:groupname:r-x" 'test/declarations.h'

# Make children files and directories inherit acls.
# A.K.A. sets default acls.
setfacl -d -m 'u:dummy:rw' 'test'

# Remove specific acls.
setfacl -x 'u:dummy:rw' 'test'

# Remove all acls.
setfacl -b 'test/declarations.h'

Further readings