GSEC · Question #156
Which of the following files contains the shadowed password entries in Linux?
The correct answer is B. /etc/shadow. The /etc/shadow file in Linux stores hashed (shadowed) user passwords and related password aging information, separated from the world-readable /etc/passwd file.
Question
Which of the following files contains the shadowed password entries in Linux?
Options
- A/etc/passwd
- B/etc/shadow
- C/etc/profile
- D/etc/shdpwd
How the community answered
(45 responses)- A2% (1)
- B82% (37)
- C7% (3)
- D9% (4)
Why each option
The /etc/shadow file in Linux stores hashed (shadowed) user passwords and related password aging information, separated from the world-readable /etc/passwd file.
/etc/passwd stores user account information such as username, UID, GID, home directory, and shell, but in modern shadow-enabled Linux systems the password field contains only an 'x' placeholder - not the actual hash.
The /etc/shadow file was introduced to store encrypted password hashes securely, restricting read access to root only, unlike /etc/passwd which is readable by all users. It also stores password expiration, aging, and account lockout metadata for each user account, making it the definitive location for shadowed password entries.
/etc/profile is a shell initialization script that sets system-wide environment variables and startup programs for interactive login shells, and contains no password data.
/etc/shdpwd is not a standard or valid Linux system file; it does not exist in any standard Linux distribution.
Concept tested: Linux shadow password file location and purpose
Source: https://man7.org/linux/man-pages/man5/shadow.5.html
Topics
Community Discussion
No community discussion yet for this question.