Soru

Zorluk: ZormacOS and Linux Operating System Features and Tools

A Linux workstation technician is configuring security permissions on a shared processing script located at `/data/reports/process.sh`. Currently, the file has permissions set to `-rw-r--r--` and is owned by `root:analytics`. Members of the `analytics` group report that they can view the script but cannot execute it. The technician must grant execute permissions to both the file owner (`root`) and the group (`analytics`), while revoking all access for all other users (`others`). Which of the following shell commands should the technician execute to achieve this objective?

  1. chmod 750 /data/reports/process.shCevap
  2. B
    chmod 775 /data/reports/process.sh
  3. C
    chown analytics:root /data/reports/process.sh
  4. D
    chmod 640 /data/reports/process.sh

Cevap

Executing chmod 750 /data/reports/process.sh correctly sets file permissions to rwxr-x---, providing execute access to owner and group while blocking others.
The command 'chmod 750 /data/reports/process.sh' correctly sets the permission bits to 7 (rwx) for the file owner, 5 (r-x) for the assigned group, and 0 (---) for all other users, satisfying all scenario requirements.

Adım Adım Çözüm

1
Analyze required permissions for each permission triad (Owner, Group, Others)
Owner requires read, write, execute (rwx = 4+2+1 = 7). Group requires read, execute (r-x = 4+0+1 = 5). Others require no permissions (--- = 0+0+0 = 0).
Linux permissions are represented by 3 octal digits corresponding to User/Owner, Group, and Others.
2
Convert permission triads into octal representation
The target octal mode is 750.
Summing the values of required bits (r=4, w=2, x=1) yields 7 for owner, 5 for group, and 0 for others.
3
Select the correct command-line utility to alter file modes
The chmod command is used to modify mode bits.
chmod (change mode) changes file access permissions, whereas chown changes file ownership.

Anahtar Kavram

Linux file permissions and octal notation using chmod
Bu soruyu puanla