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.
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
(30 responses)- A3% (1)
- B10% (3)
- C77% (23)
- D7% (2)
- E3% (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.
Permissions for `/etc/passwd` at `-rw-r-----` are too restrictive, preventing other users from reading essential account information.
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.
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.
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.
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
Community Discussion
No community discussion yet for this question.