Display whether trainee's password is usable or locked without changing it.
Which command is appropriate?
passwd -S USER displays password status, last-change information, and aging values.
Detailed explanation
passwd -l traineeIncorrect. -l locks the password.
Incorrect. -l locks the password.
passwd -S traineeCorrect. -S displays the password status.
Correct. -S displays the password status.
chage -M traineeIncorrect. -M expects a maximum-age value.
Incorrect. -M expects a maximum-age value.
last traineeIncorrect. last displays login history, not password status.
Incorrect. last displays login history, not password status.
Try it yourself
An example you can run in a temporary verification environment.
passwd --help 2>&1 | grep -E -- '-S|--status' | head -n 1Expected result
-Sまたは--statusの説明行Key points
- -S is status
- -l locks
- Separate display from change
Notes
- Environment: shadow-utils passwd help / account変更なし
- 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.