nerdexam
Linux_Foundation

LFCS · Question #766

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. Changing a user's shell to /bin/false or /sbin/nologin is the most effective and non-destructive method to prevent interactive logins.

Submitted by jakub_pl· 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.

How the community answered

(31 responses)
  • A
    19% (6)
  • B
    6% (2)
  • C
    71% (22)
  • D
    3% (1)

Why each option

Changing a user's shell to `/bin/false` or `/sbin/nologin` is the most effective and non-destructive method to prevent interactive logins.

AChanging the user's UID.

Changing the user's UID would disassociate their files and processes, potentially causing system inconsistencies and not being a standard way to suspend login.

BChanging the user's password.

Changing the user's password makes the old password invalid but is less secure and less clear than disabling the shell, as a new password could be set.

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

Changing the user's shell to `/bin/false` (or `/sbin/nologin`) in `/etc/passwd` prevents the user from starting an interactive shell upon login. This method effectively suspends interactive login capabilities without deleting the user's account or associated data.

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

Removing the user's entry in `/etc/passwd` would delete the user account entirely, which is not a temporary suspension and also removes all associated user data and permissions.

Concept tested: Suspending user interactive login

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

Topics

#User account management#Login control#Shell configuration

Community Discussion

No community discussion yet for this question.

Full LFCS Practice