Linux chage Guide - ryzendew/Linux-Tips-and-Tricks GitHub Wiki
Linux chage Guide
Complete beginner-friendly guide to chage on Linux, covering Arch Linux, CachyOS, and other distributions including password expiration, account aging, and user account policies.
Table of Contents
Understanding chage
What is chage?
chage changes user password aging information.
Uses:
- Password expiration: Set password expiry
- Account aging: Configure account lifetime
- Password policies: Enforce security policies
- Account management: Manage account settings
Why it matters:
- Security: Force password changes
- Compliance: Meet security requirements
- Account management: Control account lifecycle
chage Basics
View Information
Check user:
# Show password aging info
sudo chage -l username
# Shows:
# - Last password change
# - Password expires
# - Password inactive
# - Account expires
# - Minimum days
# - Maximum days
# - Warning days
Interactive Mode
Interactive setup:
# Interactive configuration
sudo chage username
# Follow prompts
Password Expiration
Set Expiration
Password expiry:
# Set password to expire in 90 days
sudo chage -M 90 username
# -M: Maximum days
Force Change
Require change:
# Force password change on next login
sudo chage -d 0 username
# User must change password
⏰ Account Aging
Account Expiration
Set expiry:
# Account expires on date
sudo chage -E 2024-12-31 username
# Or days from now
sudo chage -E $(date -d "+90 days" +%Y-%m-%d) username
Inactive Days
Account inactivity:
# Lock after inactive days
sudo chage -I 30 username
# Lock after 30 days inactive
Troubleshooting
chage Errors
Check user:
# Verify user exists
id username
# Check current settings
sudo chage -l username
Summary
This guide covered chage usage, password expiration, and account aging for Arch Linux, CachyOS, and other distributions.
Next Steps
- passwd Guide - Password management
- User and Groups - User management
- PAM Guide - Authentication
- chage Documentation:
man chage
This guide covers Arch Linux, CachyOS, and other Linux distributions. For distribution-specific details, refer to your distribution's documentation.