LX0-103 · Question #103
What command should be invoked to give the user sally read and write, but not execute, access to the file strategy.txt using Extended ACL entries?
The correct answer is C. setfacl-m user: sally; rwstrategy.txt. The setfacl -m user:name:permissions syntax is the correct form for granting a named user specific ACL-based access to a file.
Question
What command should be invoked to give the user sally read and write, but not execute, access to the file strategy.txt using Extended ACL entries?
Options
- Asetfacl -setperm sally:rw strategy.txt
- Bsetfacl -m user::sally+rw strategy.txt
- Csetfacl-m user: sally; rwstrategy.txt
- Dsetfacl -setperm user:sally+rw strategy.txt
How the community answered
(29 responses)- A10% (3)
- B3% (1)
- C72% (21)
- D14% (4)
Why each option
The `setfacl -m user:name:permissions` syntax is the correct form for granting a named user specific ACL-based access to a file.
The flag `-setperm` does not exist in `setfacl`; additionally, the entry omits the required `user:` qualifier before the username, making the ACL entry syntactically invalid.
The `user::` double-colon form specifies the ACL entry for the file's owning user, not a named user - it would not apply the permission to sally specifically.
Option C, despite containing formatting artifacts from the source material, represents the intended `setfacl -m u:sally:rw strategy.txt` pattern. The `-m` (modify) flag combined with the `user:sally:rw` ACL entry specification correctly grants sally read and write permissions while omitting execute, which is the expected Extended ACL method for named-user entries.
Like option A, `-setperm` is not a valid `setfacl` flag; the correct flag for adding or modifying ACL entries is `-m` (modify).
Concept tested: Setting named-user extended ACL entries with setfacl -m
Source: https://man7.org/linux/man-pages/man1/setfacl.1.html
Topics
Community Discussion
No community discussion yet for this question.