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.
Incorrect. -U unlocks the password field.
usermod -L guest01Correct. -L applies the password lock.
Correct. -L applies the password lock.
usermod -l guest01Incorrect. Lowercase -l changes the login name.
Incorrect. Lowercase -l changes the login name.
usermod -e guest01Incorrect. -e sets an account expiration date and requires a date.
Incorrect. -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
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.