LFCS practice question 18 of 35

Which character in the password field of /etc/passwd is used to indicate that the encrypted password is stored in /etc/shadow?

Full set: 260 questions
Answer options
A: *
B: -
C: s
D: x Correct answer
Correct Answer:
D. x
Explanation

In modern Linux systems that use a shadow password suite, the encrypted password for a user is not stored in the world-readable /etc/passwd file. Instead, it is stored in the /etc/shadow file, which has much more restrictive permissions. To indicate this, the password field (the second field) in the /etc/passwd file is replaced with a single 'x' character. This 'x' acts as a placeholder, signaling to authentication programs that they must look up the actual password hash in the /etc/shadow file.

Why Incorrect

A. An asterisk () in the password field typically means the account is locked and no password can be used to log in.
B. A hyphen (-) is not a standard character used in this context for indicating a shadowed password.
C. The character 's' has no standard meaning in the password field of /etc/passwd.

References

passwd(5) manual page. Under the "DESCRIPTION" section, it describes the fields of the /etc/passwd file. For the password field, it explicitly states: "If the password field contains an 'x' character, the encrypted password is in the /etc/shadow file."

Red Hat Enterprise Linux 9 Documentation, "Configuring and managing identity management," Section 1.1.1 "Local user and group files". It describes the /etc/passwd file format, noting that an "x" in the second field indicates a shadowed password.

The Linux Programming Interface, Michael Kerrisk, Chapter 8, "Users and Groups," Section 8.2, "The Password File: /etc/passwd," page 156. It states, "On all modern Linux systems... this field contains the character x, indicating that the encrypted password is to be found in the /etc/shadow file."

Scroll to Top