Skip to content

Commit

Permalink
Add acl
Browse files Browse the repository at this point in the history
  • Loading branch information
fpob committed Jun 5, 2020
1 parent 95e3278 commit aa5eed6
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions acl
@@ -0,0 +1,29 @@
# Get ACL
getfacl <file>

# Add or modify ACL on file
setfacl -m u:username:rX <file>
setfacl -m g:groupname:rw <file>
setfacl -m o::- <file>

# or provide all permissions at once
setfacl -m u::rwx,g:groupname:rX,o::- <file>

# Copy ACL from file-A to file-B
getfacl file-A | setfacl -M - file-B

# Apply ACL recursivelly to directory
setfacl -R -m u:username:rX <directory>

# Delete ACL
setfacl -x u:username,g:groupname <file>

# Delete all ACL on file, including default
setfacl -b <file>

# Same operations works for default ACLs
setfacl -m d:u:username:rx <directory>
setfacl -x d:u:username <directory>

# Delete only default ACLs
setfacl -k <directory>

0 comments on commit aa5eed6

Please sign in to comment.