In Linux, where is the user password stored ?

2023

In Linux, where is the user password stored ?

  1. A.

    / etc/password

  2. B.

    / root/password

  3. C.

    / etc/passwd

  4. 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

Explore the full course: Nta Ugc Net Paper 2

Loading lesson…