Lock guest01's password field and temporarily stop password authentication.
Which command is appropriate?
usermod -L locks the encrypted password field, commonly by adding a leading !. It does not necessarily disable every other authentication method.
Detailed explanation
usermod -U guest01Incorrect. -U unlocks the password field.
usermod -L guest01Correct. -L applies the password lock.
usermod -l guest01Incorrect. Lowercase -l changes the login name.
usermod -e guest01Incorrect. -e sets an account expiration date and requires a date.
Try it yourself
An example you can run in a temporary verification environment.
usermod --help | grep -E -- '-L,|--lock'Expected result
password lockの説明行Key points
- Uppercase -L locks
- It affects the password field
- Other authentication paths may remain
Notes
- Environment: shadow-utils usermod help / 状態変更なし
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Account record
Identity attributes such as a user ID, home directory, and login shell.
Group membership
Primary and supplementary groups used during permission checks.
Password aging
State and time limits that control password changes and account access.