102-500 · Question #139
Of the ways listed, which is the best way to temporarily suspend a single user's ability to interactively login?
The correct answer is D. Use change to expire the user account. Using chage (change age) to expire the account is the correct administrative approach because it directly and reversibly disables a single account without altering credentials or system-wide settings - simply run chage -E 0 username to expire it immediately, and reset the…
Question
Options
- AAdd the user name to /etc/nologin.
- BChange the user's password.
- CChange the user name in /etc/passwd.
- DUse change to expire the user account.
- EPlace the command logout in the user's profile.
How the community answered
(47 responses)- A9% (4)
- B2% (1)
- C4% (2)
- D70% (33)
- E15% (7)
Explanation
Using chage (change age) to expire the account is the correct administrative approach because it directly and reversibly disables a single account without altering credentials or system-wide settings - simply run chage -E 0 username to expire it immediately, and reset the expiration date to re-enable it later.
Why the distractors fail:
- A -
/etc/nologinblocks all non-root users when the file exists; it's not a per-user control and doesn't accept usernames as content. - B - Changing the password is irreversible without knowing the original, creates a support burden, and doesn't cleanly signal "account suspended" to the system.
- C - Editing the username in
/etc/passwdbreaks file ownership, running processes, and cron jobs - it's destructive, not temporary. - E - Placing
logoutin a profile script doesn't prevent login; it just terminates the session immediately after it starts, which is unreliable and easily bypassed.
Memory tip: Think of chage as "change age" - it controls the lifetime of an account. When you need to temporarily kill a single account, you're managing its age/expiration, so reach for chage.
Topics
Community Discussion
No community discussion yet for this question.