2016-12-13 22:50:24 +08:00
|
|
|
# setfacl
|
|
|
|
|
2016-12-14 00:50:54 +08:00
|
|
|
> Set file access control lists (ACL).
|
2022-03-22 03:07:48 +10:00
|
|
|
> More information: <https://manned.org/setfacl>.
|
2016-12-13 22:50:24 +08:00
|
|
|
|
2025-03-27 16:42:21 +02:00
|
|
|
- Modify ACL of a file for user with read and write access:
|
2016-12-13 22:50:24 +08:00
|
|
|
|
2025-03-27 16:42:21 +02:00
|
|
|
`setfacl {{[-m|--modify]}} u:{{username}}:rw {{path/to/file_or_directory}}`
|
2016-12-13 22:50:24 +08:00
|
|
|
|
2025-03-27 16:42:21 +02:00
|
|
|
- Modify default ACL of a file for all users:
|
2016-12-13 22:50:24 +08:00
|
|
|
|
2025-03-27 16:42:21 +02:00
|
|
|
`setfacl {{[-m|--modify]}} {{[-d|--default]}} u::rw {{path/to/file_or_directory}}`
|
2016-12-13 22:50:24 +08:00
|
|
|
|
2021-08-12 20:23:20 +02:00
|
|
|
- Remove ACL of a file for a user:
|
2016-12-13 22:50:24 +08:00
|
|
|
|
2025-03-27 16:42:21 +02:00
|
|
|
`setfacl {{[-x|--remove]}} u:{{username}} {{path/to/file_or_directory}}`
|
2016-12-13 22:50:24 +08:00
|
|
|
|
|
|
|
- Remove all ACL entries of a file:
|
|
|
|
|
2025-03-27 16:42:21 +02:00
|
|
|
`setfacl {{[-X|--remove-all]}} {{path/to/file_or_directory}}`
|