CompTIA Linux+ (XK0-006)Services and User ManagementMedium
A system administrator is auditing user accounts and needs to find out when the password for the user `jdoe` was last changed, and when it is set to expire. Which file contains this information?
- A/etc/login.defs
- B/etc/passwd
- C/etc/shadow
- D/etc/group
Show answer & explanationAnswer & explanation
Correct answer: C. /etc/shadow
The `/etc/shadow` file stores secure user account information, including encrypted passwords, password last change date, minimum/maximum password age, and expiration dates. This file is only readable by root for security reasons.
Why the other options are wrong
- A. `/etc/login.defs` defines system-wide default settings for user creation and password policies, but not individual user's specific password expiration details.
- B. `/etc/passwd` contains basic user account information (username, UID, GID, home directory, shell) but not password-related security details.
- D. `/etc/group` contains information about groups on the system.
/etc/shadow file
The `/etc/shadow` file is a critical system file that stores secure user account information, including encrypted passwords, last password change date, and password expiration policies.
- Contains encrypted passwords.
- Stores password aging information.
- Only readable by the root user.
Memory trick: SHADOW hides the password details.