To configure password aging settings like PASS_MAX_DAYS, PASS_MIN_DAYS, and PASS_WARN_AGE, you can use the chage command in Linux. Here’s how to do it:
-
Open a terminal.
-
Use the
chagecommand with the appropriate options. Here’s the syntax:sudo chage -M <max_days> -m <min_days> -W <warn_age> <username>-M <max_days>: Set the maximum days a password is valid.-m <min_days>: Set the minimum days before a password can be changed.-W <warn_age>: Set the number of days before expiration to warn the user.
-
Example: To set a maximum of 90 days, a minimum of 7 days, and a warning period of 14 days for a user named
john, you would run:sudo chage -M 90 -m 7 -W 14 john -
Verify the settings: You can check the current settings for a user with:
chage -l <username>
This will display the password aging information for the specified user. If you have any further questions or need additional examples, let me know!
