Hostxpeed
Login Get Started →
Security

How to Set Up Password Expiry

4 min read
28 views
Jun 10, 2026

Step 1: Check Current Expiry

chage -l username

Step 2: Set Password Maximum Age

sudo chage -M 90 username

Step 3: Set Minimum Age

sudo chage -m 7 username

Step 4: Set Warning Period

sudo chage -W 7 username

Step 5: Force User to Change on Next Login

sudo chage -d 0 username

View All Users with Expiry

sudo cat /etc/shadow | cut -d: -f1,5

Was this article helpful?