2025-03-14 21:59:59 -06:00
|
|
|
# chage
|
|
|
|
|
|
|
|
|
|
> Change user account and password expiry information.
|
|
|
|
|
> More information: <https://manned.org/chage>.
|
|
|
|
|
|
|
|
|
|
- List password information for the user:
|
|
|
|
|
|
2025-04-25 19:33:51 -06:00
|
|
|
`chage {{[-l|--list]}} {{username}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Enable password expiration in 10 days:
|
|
|
|
|
|
2025-04-03 20:36:56 -06:00
|
|
|
`sudo chage {{[-M|--maxdays]}} {{10}} {{username}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Disable password expiration:
|
|
|
|
|
|
2025-04-03 20:36:56 -06:00
|
|
|
`sudo chage {{[-M|--maxdays]}} {{-1}} {{username}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Set account expiration date:
|
|
|
|
|
|
2025-04-03 20:36:56 -06:00
|
|
|
`sudo chage {{[-E|--expiredate]}} {{YYYY-MM-DD}} {{username}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Force user to change password on next log in:
|
|
|
|
|
|
2025-04-03 20:36:56 -06:00
|
|
|
`sudo chage {{[-d|--lastday]}} {{0}} {{username}}`
|
|
|
|
|
|
|
|
|
|
- Re-enable an account:
|
|
|
|
|
|
|
|
|
|
`sudo chage {{[-E|--expiredate]}} -1 {{username}}`
|