In UNIX-style permissions, which chmod octal sets: owner = read/write/execute, group = read/execute, others = read/execute?

Difficulty: Easy

Correct Answer: 755

Explanation:


Introduction / Context:
File permissions on UNIX and Linux systems are commonly set using octal notation with chmod. Each digit represents a triad of permissions (read, write, execute) for owner, group, and others. Mastering octal mappings streamlines secure defaults for scripts, binaries, and web content.


Given Data / Assumptions:

  • Desired permissions: owner = rwx, group = r-x, others = r-x.
  • Octal mapping: r=4, w=2, x=1 per position.
  • Order: owner, group, others.


Concept / Approach:

Compute each triad: owner rwx = 4+2+1 = 7; group r-x = 4+0+1 = 5; others r-x = 4+0+1 = 5. Concatenate digits as owner/group/others to obtain 755. This is a common setting for executable scripts and directories where users should traverse but not modify.


Step-by-Step Solution:

Owner: rwx => 4+2+1 = 7.Group: r-x => 4+0+1 = 5.Others: r-x => 4+0+1 = 5.Final chmod octal = 755.


Verification / Alternative check:

Command example: chmod 755 file then verify with ls -l, which should display -rwxr-xr-x for a regular file.


Why Other Options Are Wrong:

  • 000: no permissions at all.
  • 744: group/others are read-only (r--), not r-x.
  • 555: everyone read/execute; owner lacks write.
  • None of the above: incorrect because 755 matches exactly.


Common Pitfalls:

  • Confusing symbolic (u=rwx,g=rx,o=rx) with octal forms.
  • Setting directories to 644, breaking traversal; directories need execute to enter.


Final Answer:

755.

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion