LFCS · Question #703
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. To grant user sally read and write access to strategy.txt using extended ACLs, the setfacl command with the modify (-m) option and specific user entry is required.
Question
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
(37 responses)- A8% (3)
- B3% (1)
- C73% (27)
- D16% (6)
Why each option
To grant user sally read and write access to strategy.txt using extended ACLs, the `setfacl` command with the modify (`-m`) option and specific user entry is required.
The `setperm` option is not a standard `setfacl` subcommand or option for modifying specific user permissions.
The syntax `user::sally+rw` is incorrect; `user::` usually refers to the file owner's effective permissions, not a specific named user, and `+rw` is not the correct way to specify permissions within `setfacl`.
The command `setfacl -m user:sally:rw strategy.txt` (assuming the semicolon is a typo and should be a colon as per standard `setfacl` syntax) correctly uses `setfacl` with the `-m` (modify) option to set an ACL entry for `user:sally` with `rw` (read and write) permissions on `strategy.txt`. This adheres to the standard `setfacl` syntax for specifying permissions for a named user.
Similar to option A, `setperm` is not a valid `setfacl` option for setting specific user permissions.
Concept tested: Linux Extended ACLs with setfacl
Source: https://man7.org/linux/man-pages/man1/setfacl.1.html
Topics
Community Discussion
No community discussion yet for this question.