Question

Difficulty: MediummacOS and Linux Operating System Features and Tools

A Linux technician needs to adjust access permissions for an executable deployment script named deploy.sh located in a shared directory. The requirements specify that the file owner must have read, write, and execute permissions, members of the assigned group must have read and execute permissions only, and all other users must have no access permissions. Which command should the technician execute to assign these permissions?

  1. chmod 750 deploy.shAnswer
  2. B
    chmod 755 deploy.sh
  3. C
    chmod 640 deploy.sh
  4. D
    chown 750 deploy.sh

Answer

The command 'chmod 750 deploy.sh' correctly configures the specified permissions by setting 7 (rwx) for the owner, 5 (r-x) for the group, and 0 (---) for others.
In Linux file permission syntax, octal values represent access levels for User (owner), Group, and Others in sequence. Read equals 4, write equals 2, and execute equals 1. Therefore, owner (4+2+1=7), group (4+0+1=5), and others (0) produce the permission mask 750 applied via the chmod utility.

Step-by-Step Solution

1
Calculate the octal permission value for the owner.
Read (4) + Write (2) + Execute (1) = 7.
The owner requires full read, write, and execution capabilities.
2
Calculate the octal permission value for the group.
Read (4) + Write (0) + Execute (1) = 5.
Group members require read and execute rights without file modification rights.
3
Calculate the octal permission value for all other users.
Read (0) + Write (0) + Execute (0) = 0.
Unassigned external users must be completely denied access.
4
Combine the octal values into a full mode string and select the proper command binary.
chmod 750 deploy.sh
The 'chmod' utility modifies file permissions, whereas 'chown' alters user and group ownership.

Key Concept

Linux Absolute Octal File Permissions (chmod)
Rate this question