102-500 practice question 25 of 30

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

Full set: 233 questions
Answer options
A: -rw-r-----, -r--------
B: -rw-r--r--, -r--r--r--
C: -rw-r--r--, -r-------- Correct answer
D: -rw-r--rw-, -r-----r--
E: -rw-------, -r--------
Correct Answer:
C. -rw-r--r--, -r--------
Explanation

The /etc/passwd file contains user account information (but not passwords) and must be readable by all users and processes to map user IDs to usernames. Therefore, permissions of rw-r--r-- (644) are standard. The /etc/shadow file contains sensitive hashed passwords and aging information. To maintain security, it must be protected from all non-privileged users. Making it readable only by the root user, with permissions r-------- (400), is a common and secure configuration that prevents unauthorized access.

Why Incorrect

A: The permissions for /etc/passwd are too restrictive; many system processes and users need to read this file for UID/username mapping. B: The permissions for /etc/shadow are dangerously insecure, allowing any user on the system to read the hashed passwords. D: The permissions for /etc/passwd are world-writable, and /etc/shadow is world-readable, both of which are severe security vulnerabilities. E: The permissions for /etc/passwd are too restrictive, which would break many system functions that rely on resolving user information.

References

1. shadow(5) Linux manual page. In the DESCRIPTION section, it states: "The shadow file is readable only by root."

2. Red Hat Enterprise Linux 8 Documentation, "Securing Red Hat Enterprise Linux", Chapter 2, Section 2.1. "The /etc/passwd file should have permissions set to 644... The /etc/shadow file should have permissions set to 000." (Note: 400 is also a common secure practice).

3. Kerrisk, M. (2010). The Linux Programming Interface. No Starch Press. Chapter 9, Section 9.6, p. 181. "The /etc/passwd file is world-readable... The /etc/shadow file... is readable only by root."

Scroll to Top