nerdexam
Linux_Foundation

LFCS · 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--------. For shadowed passwords, /etc/passwd must be world-readable (-rw-r--r--) for system processes, while /etc/shadow must be readable only by root (-r--------) to protect sensitive password hashes.

Submitted by yasin.bd· Apr 18, 2026User and Group Management

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

(39 responses)
  • A
    3% (1)
  • B
    3% (1)
  • C
    87% (34)
  • D
    8% (3)

Why each option

For shadowed passwords, `/etc/passwd` must be world-readable (`-rw-r--r--`) for system processes, while `/etc/shadow` must be readable only by root (`-r--------`) to protect sensitive password hashes.

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

The permissions `-rw-r-----` for `/etc/passwd` restrict read access for 'others', which can cause issues for programs needing to map UIDs to usernames.

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

The permissions `-r--r--r--` for `/etc/shadow` make the password hashes world-readable, posing a severe security risk.

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

The `/etc/passwd` file stores user account information (excluding password hashes) and must be readable by all users (`-rw-r--r--` or 644) for various system utilities. The `/etc/shadow` file contains encrypted password hashes and sensitive security details, requiring it to be readable only by the root user (`-r--------` or 400) to maintain system security.

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

The permissions `-rw-r--rw-` for `/etc/passwd` allow 'others' to write to the file, which is a significant security vulnerability, and `-r-----r--` for `/etc/shadow` still allows 'others' to read it.

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

The permissions `-rw-------` for `/etc/passwd` restrict read access to only the owner (root), which can break system functionality requiring user lookup.

Concept tested: Linux password file permissions

Source: https://man7.org/linux/man-pages/man5/shadow.5.html

Topics

#File Permissions#User Accounts#System Security#Shadow Passwords

Community Discussion

No community discussion yet for this question.

Full LFCS Practice