LFCS · Question #518
Of the ways listed, which is the best method to temporarily suspend a user's ability to interactively login?
The correct answer is B. Use chage to expire the user account. The best method to temporarily suspend a user's ability to interactively log in is to use chage to set an account expiration date.
Question
Options
- AUse passwd -d username to give the user an empty password.
- BUse chage to expire the user account.
- CChange the user's password.
- DAdd the command exit to the user's .login file.
How the community answered
(49 responses)- A2% (1)
- B88% (43)
- C6% (3)
- D4% (2)
Why each option
The best method to temporarily suspend a user's ability to interactively log in is to use `chage` to set an account expiration date.
`passwd -d username` removes the password, which may enable passwordless login on some systems or is generally a less secure and less explicit way to suspend an account than expiration.
Using `chage -E YYYY-MM-DD username` allows an administrator to set an expiration date for a user account, effectively preventing login until the expiration is removed or extended, providing a clean and reversible method for temporary suspension. Setting `-E 1` for today's date would immediately expire it, and `-E -1` would disable expiration.
Changing the user's password forces them to use a new password, which is a disruption and less clear than an account suspension, and requires explicit communication and resetting later.
Adding `exit` to a user's `.login` or shell startup file is a less robust and potentially fragile method, as it relies on specific shell configurations and may not prevent all forms of interactive access.
Concept tested: Linux user account management and suspension
Source: https://man7.org/linux/man-pages/man1/chage.1.html
Topics
Community Discussion
No community discussion yet for this question.