SK0-004 · Question #361
Which of the following represents the directory permissions to provide least privilege for publicly readable directories on a Unix web server?
The correct answer is C. rwxrwxr-x (775). For a publicly readable Unix web server directory, 775 (rwxrwxr-x) grants others the minimum permissions needed - read and execute - without allowing writes.
Question
Which of the following represents the directory permissions to provide least privilege for publicly readable directories on a Unix web server?
Options
- Arwxrwxrwx (777)
- Brwxrwx-w- (772)
- Crwxrwxr-x (775)
- Drwxrwx-x (771)
How the community answered
(46 responses)- A7% (3)
- B15% (7)
- C74% (34)
- D4% (2)
Why each option
For a publicly readable Unix web server directory, 775 (rwxrwxr-x) grants others the minimum permissions needed - read and execute - without allowing writes.
777 (rwxrwxrwx) grants all users including anonymous others full write access, violating least privilege by allowing unauthorized file creation, modification, or deletion.
772 (rwxrwx-w-) gives others only write permission with no read or execute, making the directory unreadable to the public while introducing an unnecessary write vulnerability.
The permission 775 (rwxrwxr-x) gives the owner and group full control while restricting others to read and execute only. Read permission allows file contents to be served, and execute permission on a directory is required for users to traverse or list it; withholding write permission from others enforces least privilege correctly for a public web directory.
771 (rwxrwx--x) grants others only execute permission, allowing directory traversal but blocking file reads, which prevents public access to the directory contents.
Concept tested: Unix directory permissions least privilege for public web directories
Source: https://www.redhat.com/sysadmin/linux-file-permissions-explained
Topics
Community Discussion
No community discussion yet for this question.