In Linux, where is the user password stored ?
2023
In Linux, where is the user password stored ?
- A.
/ etc/password
- B.
/ root/password
- C.
/ etc/passwd
- D.
/ root/passwd
Attempted by 117 students.
Show answer & explanation
Correct answer: C
Answer: /etc/passwd (account information)
Explanation:
/etc/passwd contains user account information such as username, UID, GID, home directory, and login shell. Historically it contained the password field as well.
/etc/shadow stores the encrypted password hashes on modern Linux systems. It is readable only by the root user for security.
Because of this, many introductory questions accept /etc/passwd as the answer, but the most accurate location for password hashes is /etc/shadow.
Key takeaway: user account info -> /etc/passwd; encrypted password hashes -> /etc/shadow
Loading lesson…