nerdexam
Linux_Foundation

LFCS · Question #272

Which of the following is the BEST way to temporarily suspend a user's ability to interactively login?

The correct answer is C. Changing the user's shell to /bin/false. The most effective way to temporarily prevent a user from interactively logging in is by changing their shell to a non-login shell.

Submitted by amina.ke· Apr 18, 2026User and Group Management

Question

Which of the following is the BEST way to temporarily suspend a user's ability to interactively login?

Options

  • AChanging the user's UID.
  • BChanging the user's password.
  • CChanging the user's shell to /bin/false.
  • DRemoving the user's entry in /etc/passwd.
  • EPlacing the command logout in the user's profile.

How the community answered

(53 responses)
  • A
    11% (6)
  • B
    2% (1)
  • C
    79% (42)
  • D
    6% (3)
  • E
    2% (1)

Why each option

The most effective way to temporarily prevent a user from interactively logging in is by changing their shell to a non-login shell.

AChanging the user's UID.

Changing a user's UID is a destructive action that breaks file ownership and permissions, leading to data loss or system instability, and is not a temporary suspension method.

BChanging the user's password.

Changing the user's password only prevents login if the user doesn't know the new password, but it doesn't fundamentally disable interactive login capability; an administrator could simply provide the new password.

CChanging the user's shell to /bin/false.Correct

Changing a user's shell to `/bin/false` (or `/sbin/nologin`) prevents them from starting an interactive shell session upon login. This method disables interactive access while preserving the user account, home directory, and other settings for potential future re-enablement.

DRemoving the user's entry in /etc/passwd.

Removing the user's entry in `/etc/passwd` permanently deletes the account and all associated metadata, which is not a temporary suspension.

EPlacing the command logout in the user's profile.

Placing `logout` in the user's profile would only log them out immediately *after* they successfully log in, effectively creating an infinite login loop rather than preventing login.

Concept tested: User account management, login shells

Source: https://man7.org/linux/man-pages/man8/usermod.8.html

Topics

#User management#Account suspension#Interactive login#Shell access

Community Discussion

No community discussion yet for this question.

Full LFCS Practice