nerdexam
CompTIA

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.

Security and disaster recovery

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)
  • A
    7% (3)
  • B
    15% (7)
  • C
    74% (34)
  • D
    4% (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.

Arwxrwxrwx (777)

777 (rwxrwxrwx) grants all users including anonymous others full write access, violating least privilege by allowing unauthorized file creation, modification, or deletion.

Brwxrwx-w- (772)

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.

Crwxrwxr-x (775)Correct

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.

Drwxrwx-x (771)

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

#Unix permissions#least privilege#file permissions#web server security

Community Discussion

No community discussion yet for this question.

Full SK0-004 Practice