nerdexam
Linux_Foundation

LFCS · Question #265

Which of the following should the permission settings be for /etc/passwd and /etc/shadow?

The correct answer is A. /etc/passwd: -rw-r--r-- /etc/shadow: -r--------. File permissions for /etc/passwd allow all users to read basic account information, while /etc/shadow is restricted to root-only read access to protect password hashes.

Submitted by carlos_mx· Apr 18, 2026User and Group Management

Question

Which of the following should the permission settings be for /etc/passwd and /etc/shadow?

Options

  • A/etc/passwd: -rw-r--r-- /etc/shadow: -r--------
  • B/etc/passwd: -r-------- /etc/shadow: -rw-r--r--
  • C/etc/passwd: -rw-r--r-- /etc/shadow: -rw-r--r--
  • D/etc/passwd: -r-------- /etc/shadow: -r--------}

How the community answered

(59 responses)
  • A
    90% (53)
  • B
    2% (1)
  • C
    7% (4)
  • D
    2% (1)

Why each option

File permissions for /etc/passwd allow all users to read basic account information, while /etc/shadow is restricted to root-only read access to protect password hashes.

A/etc/passwd: -rw-r--r-- /etc/shadow: -r--------Correct

The /etc/passwd file requires `-rw-r--r--` (octal 644) permissions, allowing the owner (root) to read/write, and other users to read it, which is necessary for many system utilities. The /etc/shadow file, containing sensitive password hashes, must have `-r--------` (octal 400) permissions, restricting read access exclusively to the root user for security.

B/etc/passwd: -r-------- /etc/shadow: -rw-r--r--

This option incorrectly restricts /etc/passwd to root-only read, which breaks common system functionality, and grants too much read/write access to /etc/shadow.

C/etc/passwd: -rw-r--r-- /etc/shadow: -rw-r--r--

This option grants read and write access to /etc/shadow to all users, which is a severe security vulnerability.

D/etc/passwd: -r-------- /etc/shadow: -r--------}

This option restricts /etc/passwd to root-only read, which would prevent many services and users from functioning correctly, and provides correct but incomplete permissions for shadow.

Concept tested: /etc/passwd and /etc/shadow permissions

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

Topics

#File permissions#/etc/passwd#/etc/shadow#Security

Community Discussion

No community discussion yet for this question.

Full LFCS Practice