CompTIA
LX0-103 · Question #56
LX0-103 Question #56: Real Exam Question with Answer & Explanation
The correct answer is A. chmod u=rwx,go=rx /bin/foo. Making a file executable by everyone but writable only by its owner requires the 755 (rwxr-xr-x) permission set, which the symbolic expression u=rwx,go=rx produces exactly.
GNU and Unix Commands
Question
Which of the following commands makes /bin/foo executable by everyone but writable only by its owner?
Options
- Achmod u=rwx,go=rx /bin/foo
- Bchmod o+rwx,a+rx /bin/foo
- Cchmod 577 /bin/foo
- Dchmod 775 /bin/foo
Explanation
Making a file executable by everyone but writable only by its owner requires the 755 (rwxr-xr-x) permission set, which the symbolic expression u=rwx,go=rx produces exactly.
Common mistakes.
- B. The token o+rwx adds write permission to the others class, which directly violates the requirement that only the owner may write to the file.
- C. Octal 577 translates to r-x/rwx/rwx, which denies write permission to the owner while granting it to both group and others - the opposite of the stated requirement.
- D. Octal 775 translates to rwx/rwx/r-x, which grants write permission to the group in addition to the owner, violating the writable-only-by-owner constraint.
Concept tested. chmod symbolic notation for precise permission assignment
Reference. https://man7.org/linux/man-pages/man1/chmod.1.html
Topics
#chmod#file permissions#symbolic mode#execute bit
Community Discussion
No community discussion yet for this question.