Linux_FoundationLinux_Foundation
LFCS · Question #767
LFCS Question #767: Real Exam Question with Answer & Explanation
The correct answer is D: Edit /etc/passwd and insert an * after thefirst : .. Inserting an asterisk (*) into the password field of /etc/passwd or /etc/shadow effectively disables the account by making the password invalid.
Submitted by jakub_pl· Apr 18, 2026User and Group Management
Question
You have a user whose account you want to disable but not remove. What should you do?
Options
- AEdit /etc/gshadow and just remove his name.
- BEdit /etc/passwd and change all numbers to 0.
- CEdit /etc/shadow and remove the last field.
- DEdit /etc/passwd and insert an * after thefirst : .
- EEdit /etc/group file and put a # sign in front of his name.
Explanation
Inserting an asterisk (*) into the password field of /etc/passwd or /etc/shadow effectively disables the account by making the password invalid.
Common mistakes.
- A. Editing
/etc/gshadowto remove a user's name would only affect group memberships for shadowed groups, not disable the user's login. - B. Changing all numbers to 0 in
/etc/passwdwould corrupt the user's UID, GID, and other fields, potentially rendering the account unusable and causing system issues, rather than simply disabling login. - C. Removing the last field from
/etc/shadow(typically the expiry date) would not disable the password or account. - E. Editing
/etc/groupand commenting out a user's name with#would not disable their login, it would only affect their group memberships.
Concept tested. Disabling a user account
Reference. https://linux.die.net/man/5/passwd
Topics
#User accounts#Account disabling#/etc/passwd#Security
Community Discussion
No community discussion yet for this question.