XK0-005 · Question #1511
A systems administrator requires that all files that are created by the user named web have read- only permissions by the owner. Which of the following commands will satisfy this requirement?
The correct answer is C. echo "umask 377" >> /home/web/.bashrc. The umask defines which permission bits are masked off when new files are created. With a umask of 377, the resulting file permissions are calculated as 666 (default file permissions) ANDed with the complement of 377 (which is 400), yielding permissions of 400 (r--------)…
Question
Options
- Achown web:web /home/web
- Bchmod -R 400 /home/web
- Cecho "umask 377" >> /home/web/.bashrc
- Dsetfacl read /home/web
How the community answered
(33 responses)- A12% (4)
- B6% (2)
- C79% (26)
- D3% (1)
Explanation
The umask defines which permission bits are masked off when new files are created. With a umask of 377, the resulting file permissions are calculated as 666 (default file permissions) ANDed with the complement of 377 (which is 400), yielding permissions of 400 (r--------) - read-only for the owner, no permissions for group or others. Appending this to /home/web/.bashrc ensures it applies every time the user logs in. Option A changes directory ownership, not permissions. Option B retroactively sets permissions on existing files with chmod -R but does not affect future files. Option D uses incorrect setfacl syntax and would not configure a default permission mask.
Topics
Community Discussion
No community discussion yet for this question.