nerdexam
CompTIA

LX0-104 · Question #445

On a system using shadowed passwords, the correct permissions for /etc/passwd are ___ and the correct permissions for /etc/shadow are ___.

The correct answer is C. -rw-r--r--, -r--------. On a system utilizing shadowed passwords, the /etc/passwd file should be readable by all users, while the /etc/shadow file, containing hashed passwords, must have highly restricted permissions readable only by root.

Security

Question

On a system using shadowed passwords, the correct permissions for /etc/passwd are ___ and the correct permissions for /etc/shadow are ___.

Options

  • A-rw-r-----, -r--------
  • B-rw-r--r--, -r--r--r--
  • C-rw-r--r--, -r--------
  • D-rw-r--rw-, -r-----r--
  • E-rw-------, -r--------

How the community answered

(30 responses)
  • A
    3% (1)
  • B
    10% (3)
  • C
    77% (23)
  • D
    7% (2)
  • E
    3% (1)

Why each option

On a system utilizing shadowed passwords, the `/etc/passwd` file should be readable by all users, while the `/etc/shadow` file, containing hashed passwords, must have highly restricted permissions readable only by root.

A-rw-r-----, -r--------

Permissions for `/etc/passwd` at `-rw-r-----` are too restrictive, preventing other users from reading essential account information.

B-rw-r--r--, -r--r--r--

Permissions for `/etc/shadow` at `-r--r--r--` are too permissive, allowing all users to read sensitive hashed password data, which is a significant security risk.

C-rw-r--r--, -r--------Correct

The `/etc/passwd` file, which lists user accounts but not hashed passwords in a shadowed system, typically has `644` permissions (`-rw-r--r--`), allowing all users to read it to identify usernames and UIDs. The `/etc/shadow` file, which stores the sensitive hashed passwords, must be strictly protected with `400` permissions (`-r--------`), granting read access exclusively to the root user.

D-rw-r--rw-, -r-----r--

Permissions for `/etc/passwd` at `-rw-r--rw-` are too permissive, allowing others to write to the file, and `/etc/shadow` at `-r-----r--` allows others to read, which are both critical security flaws.

E-rw-------, -r--------

Permissions for `/etc/passwd` at `-rw-------` are too restrictive, preventing non-root users from reading basic user account information required by many system utilities.

Concept tested: Linux file permissions for sensitive user files

Source: https://learn.microsoft.com/en-us/previous-versions/tn-archive/dd277645(v=technet.10)

Topics

#file permissions#shadow passwords#/etc/passwd#/etc/shadow

Community Discussion

No community discussion yet for this question.

Full LX0-104 Practice