nerdexam
Linux_Foundation

LFCS · Question #465

Of the ways listed, which 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. To temporarily suspend a user's ability to log in interactively, changing their default shell to /bin/false or /sbin/nologin is the best method.

Submitted by andreas_gr· Apr 18, 2026User and Group Management

Question

Of the ways listed, which 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

(52 responses)
  • B
    4% (2)
  • C
    87% (45)
  • D
    2% (1)
  • E
    8% (4)

Why each option

To temporarily suspend a user's ability to log in interactively, changing their default shell to `/bin/false` or `/sbin/nologin` is the best method.

AChanging the user's UID.

Changing a user's UID would invalidate their file ownership and permissions, causing significant system issues beyond just suspending login.

BChanging the user's password.

Changing the user's password would prevent them from logging in unless they are given the new password, which is not a 'temporary suspension' in the same controlled manner as changing the shell.

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

By setting a user's shell to `/bin/false` (or `/sbin/nologin`), the system will execute this program upon login, which immediately exits with an error status, preventing the user from getting an interactive shell while keeping their account intact.

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

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

EPlacing the command logout in the user's profile.

Placing `logout` in a user's profile would still allow the user to initiate a login and their shell environment, which is less secure and less controlled than preventing shell execution altogether.

Concept tested: Suspending user interactive login

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

Topics

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

Community Discussion

No community discussion yet for this question.

Full LFCS Practice