Unlock guest01 after it was locked with usermod -L.
Which command is appropriate?
usermod -U removes the password lock applied by -L.
Detailed explanation
usermod -L guest01Incorrect. -L applies the lock.
Incorrect. -L applies the lock.
usermod -u guest01Incorrect. Lowercase -u changes the UID and needs a numeric argument.
Incorrect. Lowercase -u changes the UID and needs a numeric argument.
usermod -U guest01Correct. -U unlocks the password field.
Correct. -U unlocks the password field.
usermod -l guest01Incorrect. Lowercase -l changes the login name.
Incorrect. Lowercase -l changes the login name.
Try it yourself
An example you can run in a temporary verification environment.
usermod --help | grep -E -- '-U,|--unlock'Expected result
password unlockの説明行Key points
- Uppercase -U unlocks
- Lowercase -u changes UID
- Case matters
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.