nerdexam
CompTIA

LX0-104 · Question #689

What happens if the password of a user in the /etc/shadow file is prepended with the ! character?

The correct answer is E. The password becomes invalid which disables password based logins although other login. Prepending an exclamation mark (!) to a password hash in /etc/shadow disables password-based logins for that user, while other authentication methods remain functional.

Security

Question

What happens if the password of a user in the /etc/shadow file is prepended with the ! character?

Options

  • AWhen logging in, the user automatically gets root privileges in addition to his regular
  • BThe password is inverted which allows the user to log in with any password other than the
  • CThe user is disabled and all login methods, including but not limited to password based logins,
  • DUpon the next log in, the user is forced to change his password.
  • EThe password becomes invalid which disables password based logins although other login

How the community answered

(31 responses)
  • B
    3% (1)
  • C
    3% (1)
  • E
    94% (29)

Why each option

Prepending an exclamation mark (`!`) to a password hash in `/etc/shadow` disables password-based logins for that user, while other authentication methods remain functional.

AWhen logging in, the user automatically gets root privileges in addition to his regular

Prepending `!` to a password hash does not grant root privileges; its function is to disable password authentication.

BThe password is inverted which allows the user to log in with any password other than the

The password is not inverted; instead, the `!` character explicitly marks the password as disabled, preventing any successful password-based login.

CThe user is disabled and all login methods, including but not limited to password based logins,

This action disables password-based logins specifically; it does not necessarily disable all login methods, as SSH key-based authentication or other methods might still be available.

DUpon the next log in, the user is forced to change his password.

Disabling a password with `!` prevents login attempts with a password and does not force the user to change their password upon the next login.

EThe password becomes invalid which disables password based logins although other loginCorrect

When the password field in `/etc/shadow` begins with an `!` character, the system renders the password hash invalid, effectively disabling all password-based login attempts for that specific user. However, other authentication mechanisms, such as SSH key-based authentication, would still work if correctly configured for the user.

Concept tested: Disabling Linux user password logins

Source: https://man7.org/linux/man-pages/man5/shadow.5.html

Topics

#/etc/shadow#password disable#user account status

Community Discussion

No community discussion yet for this question.

Full LX0-104 Practice