2025-03-14 21:59:59 -06:00
|
|
|
# setfacl
|
|
|
|
|
|
|
|
|
|
> Set file access control lists (ACL).
|
|
|
|
|
> More information: <https://manned.org/setfacl>.
|
|
|
|
|
|
2025-04-03 20:36:56 -06:00
|
|
|
- Modify ACL of a file for user with read and write access:
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2025-04-03 20:36:56 -06:00
|
|
|
`setfacl {{[-m|--modify]}} u:{{username}}:rw {{path/to/file_or_directory}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2025-04-03 20:36:56 -06:00
|
|
|
- Modify default ACL of a file for all users:
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2025-04-03 20:36:56 -06:00
|
|
|
`setfacl {{[-m|--modify]}} {{[-d|--default]}} u::rw {{path/to/file_or_directory}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Remove ACL of a file for a user:
|
|
|
|
|
|
2025-04-03 20:36:56 -06:00
|
|
|
`setfacl {{[-x|--remove]}} u:{{username}} {{path/to/file_or_directory}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Remove all ACL entries of a file:
|
|
|
|
|
|
2025-07-24 22:27:13 -06:00
|
|
|
`setfacl {{[-b|--remove-all]}} {{path/to/file_or_directory}}`
|