Expire alice's account on 2026-12-31.
Set account expiry rather than the maximum password age.
Which command is appropriate?
chage -E DATE USER sets account expiry independently of password-aging limits.
Detailed explanation
chage -M 2026-12-31 aliceIncorrect. -M expects a numeric maximum password age.
Incorrect. -M expects a numeric maximum password age.
chage -E 2026-12-31 aliceCorrect. -E sets the account expiration date.
Correct. -E sets the account expiration date.
chage -W 2026-12-31 aliceIncorrect. -W sets a password-expiry warning period.
Incorrect. -W sets a password-expiry warning period.
chage -d 2026-12-31 aliceIncorrect. -d sets the last password-change date.
Incorrect. -d sets the last password-change date.
Try it yourself
An example you can run in a temporary verification environment.
chage --help 2>&1 | grep -E -- '--expiredate|-E,' | head -n 1Expected result
-Eまたは--expiredateの説明Key points
- -E account expiry
- Specify a date
- Different from -M
Notes
- Environment: shadow-utils chage / 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.