CompTIA Linux+ (XK0-005) — Question 22
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?
Answer options
- A. chown web:web /home/web
- B. chmod -R 400 /home/web
- C. echo "umask 377" >> /home/web/.bashrc
- D. setfacl read /home/web
Correct answer: C
Explanation
The correct answer is C because setting the umask to 377 will ensure that new files created by the user 'web' have read-only permissions for the owner. Option A changes the ownership but does not affect permissions, B sets restrictive permissions globally, and D is for setting access control lists which also doesn't set the desired permission for new files.