chage
Overview
The chage
command changes user password expiry information. It modifies the number of days between password changes and checks password aging.
Syntax
chage [options] username
Common Options
Option | Description |
---|---|
-d days |
Last change |
-E date |
Account expiry |
-I days |
Inactive days |
-l |
List aging info |
-m days |
Minimum days |
-M days |
Maximum days |
-W days |
Warning days |
--help |
Show help |
--version |
Show version |
Configuration Files
File | Description |
---|---|
/etc/shadow | Password data |
/etc/login.defs | Login defaults |
/etc/pam.d/system-auth | PAM config |
/etc/security/limits.conf | System limits |
Key Use Cases
- Password aging
- Account expiry
- Security policy
- User management
- Access control
Examples with Explanations
Example 1: List Info
chage -l username
Show aging info
Example 2: Set Expiry
chage -E 2024-12-31 username
Set account expiry
Example 3: Force Change
chage -d 0 username
Force password change
Common Usage Patterns
View settings:
chage -l user
Set maximum:
chage -M 90 user
Set warning:
chage -W 7 user
Security Considerations
- Password policy
- Account access
- Expiry control
- Security compliance
- User notification
Additional Resources
Best Practices
- Regular updates
- Policy compliance
- User notification
- Documentation
- Security audit
Password Management
- Aging control
- Expiry settings
- Policy enforcement
- Access management
- Security control
Troubleshooting
- Expiry issues
- Policy conflicts
- Access problems
- System errors
- User complaints
Common Issues
- Expired passwords
- Account lockouts
- Policy violations
- System conflicts
- User confusion