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.
passwd -S traineeCorrect. -S displays the password status.
chage -M traineeIncorrect. -M expects a maximum-age value.
last traineeIncorrect. 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
Permission bit
A mode bit controlling read, write, execute, or special execution behavior.
Account state
Attributes that determine whether a password or login account can be used.
Resource limit
A per-process or per-user ceiling such as open files or process count.