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.
Question
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)- A19% (6)
- B6% (2)
- C71% (22)
- D3% (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.
Changing the user's UID would disassociate their files and processes, potentially causing system inconsistencies and not being a standard way to suspend login.
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.
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.
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
Community Discussion
No community discussion yet for this question.