Skip to content

Linux chage Guide

Mattscreative edited this page Dec 5, 2025 · 2 revisions

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

  1. Understanding chage
  2. chage Basics
  3. Password Expiration
  4. Account Aging
  5. Troubleshooting

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


This guide covers Arch Linux, CachyOS, and other Linux distributions. For distribution-specific details, refer to your distribution's documentation.

Clone this wiki locally