Expire contractor's account on 2026-09-30.
Do not change the maximum password age.
Which command is appropriate?
chage -E DATE USER sets the account expiration date, separate from password aging such as -M.
Detailed explanation
passwd -x 2026-09-30 contractorIncorrect. passwd -x expects a password maximum age in days.
Incorrect. passwd -x expects a password maximum age in days.
chage -W 2026-09-30 contractorIncorrect. -W sets password-expiry warning days.
Incorrect. -W sets password-expiry warning days.
chage -E 2026-09-30 contractorCorrect. -E sets the account expiry date.
Correct. -E sets the account expiry date.
passwd -S contractorIncorrect. -S only displays status.
Incorrect. -S only displays status.
Try it yourself
An example you can run in a temporary verification environment.
chage --help 2>&1 | grep -E -- '-E|--expiredate' | head -n 1Expected result
-Eまたは--expiredateの説明行Key points
- -E is account expiry
- -M is password maximum age
- -W is warning days
Notes
- Environment: shadow-utils chage 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.