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.
Question
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)- A3% (1)
- B3% (1)
- C87% (34)
- D8% (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.
The permissions `-rw-r-----` for `/etc/passwd` restrict read access for 'others', which can cause issues for programs needing to map UIDs to usernames.
The permissions `-r--r--r--` for `/etc/shadow` make the password hashes world-readable, posing a severe security risk.
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.
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.
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
Community Discussion
No community discussion yet for this question.