nerdexam
Linux_Foundation

LFCS · Question #490

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

The correct answer is D. Use chage to expire the user account. Expiring a user account using the chage command is the most effective and reversible way to temporarily suspend a single user's interactive login ability.

Submitted by kwame.gh· Apr 18, 2026User and Group Management

Question

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

Options

  • AAdd the user name to /etc/nologin.
  • BChange the user's password.
  • CChange the user name in /etc/passwd.
  • DUse chage to expire the user account.
  • EPlace the command logout in the user's profile.

How the community answered

(42 responses)
  • A
    5% (2)
  • B
    2% (1)
  • D
    90% (38)
  • E
    2% (1)

Why each option

Expiring a user account using the `chage` command is the most effective and reversible way to temporarily suspend a single user's interactive login ability.

AAdd the user name to /etc/nologin.

The `/etc/nologin` file prevents *all* non-root users from logging in with a specific message, making it a system-wide lock, not a method for a single user.

BChange the user's password.

Changing the user's password prevents them from logging in, but it's not a "temporary suspension" in the sense that their password is now different. It requires another password change to restore access, which is less graceful than an expiration date.

CChange the user name in /etc/passwd.

Changing the user name in `/etc/passwd` would corrupt the user's account and is not a temporary suspension method; it would effectively disable the account entirely in an ungraceful way.

DUse chage to expire the user account.Correct

Using the `chage` command to set an immediate or past account expiration date (`chage -E YYYY-MM-DD username`) is an effective and easily reversible method to temporarily prevent a specific user from interactively logging in. Once the account is expired, login attempts will be denied until the expiration date is updated.

EPlace the command logout in the user's profile.

Placing `logout` in a user's profile script would allow them to log in briefly before being logged out, which is not a complete suspension of their ability to interactively log in and can potentially be bypassed.

Concept tested: Suspending user interactive login

Topics

#User management#Account expiration#chage command#Login control

Community Discussion

No community discussion yet for this question.

Full LFCS Practice