All mock tests are FREE till 31 December — register to save your progress

In Linux, where is the user password stored?

Pick an option to check yourself, or open the answer below.

Show answer & explanation

Correct answer: C. /etc/passwd

Explanation

User account information, including (historically) the password field, is kept in the system file /etc/passwd, which every process can read since it also stores usernames, UID/GID and shell information needed for login and lookups. On modern distributions the actual password hash is moved out to the root-readable-only /etc/shadow for security, leaving just a placeholder in /etc/passwd, but at the level this question is pitched, /etc/passwd is the standard textbook answer. The other three paths are not real system files — there is no /etc/password or any /root/password(s) file in a standard Linux installation. Hence option (iii) is correct.

More System Software and Operating System questions