nerdexam
Linux_Foundation

LFCS · Question #518

Of the ways listed, which is the best method to temporarily suspend a user's ability to interactively login?

The correct answer is B. Use chage to expire the user account. The best method to temporarily suspend a user's ability to interactively log in is to use chage to set an account expiration date.

Submitted by sofia.br· Apr 18, 2026User and Group Management

Question

Of the ways listed, which is the best method to temporarily suspend a user's ability to interactively login?

Options

  • AUse passwd -d username to give the user an empty password.
  • BUse chage to expire the user account.
  • CChange the user's password.
  • DAdd the command exit to the user's .login file.

How the community answered

(49 responses)
  • A
    2% (1)
  • B
    88% (43)
  • C
    6% (3)
  • D
    4% (2)

Why each option

The best method to temporarily suspend a user's ability to interactively log in is to use `chage` to set an account expiration date.

AUse passwd -d username to give the user an empty password.

`passwd -d username` removes the password, which may enable passwordless login on some systems or is generally a less secure and less explicit way to suspend an account than expiration.

BUse chage to expire the user account.Correct

Using `chage -E YYYY-MM-DD username` allows an administrator to set an expiration date for a user account, effectively preventing login until the expiration is removed or extended, providing a clean and reversible method for temporary suspension. Setting `-E 1` for today's date would immediately expire it, and `-E -1` would disable expiration.

CChange the user's password.

Changing the user's password forces them to use a new password, which is a disruption and less clear than an account suspension, and requires explicit communication and resetting later.

DAdd the command exit to the user's .login file.

Adding `exit` to a user's `.login` or shell startup file is a less robust and potentially fragile method, as it relies on specific shell configurations and may not prevent all forms of interactive access.

Concept tested: Linux user account management and suspension

Source: https://man7.org/linux/man-pages/man1/chage.1.html

Topics

#User account management#Account expiration#User login control#chage command

Community Discussion

No community discussion yet for this question.

Full LFCS Practice