Require alice to change the password after at most 90 days.
Which command is appropriate?
chage -M DAYS sets the maximum password age; -m, -W, and -I control other aging intervals.
Detailed explanation
chage -M 90 aliceCorrect. -M 90 sets the maximum password age to 90 days.
Correct. -M 90 sets the maximum password age to 90 days.
chage -m 90 aliceIncorrect. -m sets the minimum time between password changes.
Incorrect. -m sets the minimum time between password changes.
chage -W 90 aliceIncorrect. -W sets the warning period before expiry.
Incorrect. -W sets the warning period before expiry.
chage -I 90 aliceIncorrect. -I sets the inactive period after password expiry.
Incorrect. -I sets the inactive period after password expiry.
Try it yourself
An example you can run in a temporary verification environment.
chage --help 2>&1 | grep -E -- '--maxdays|-M,' | head -n 1Expected result
-Mまたは--maxdaysの説明Key points
- -M maximum age
- -m minimum age
- -W warning
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.