Site icon New Generation Enterprise Linux

Stop chasing down every user session when you need to force a password change

User & Group Management

Stop chasing down every user session when you need to force a password change

đź§© The Challenge

Dealing with a security audit where half your users have permanent password settings is a nightmare. You shouldn’t have to hunt down their current status manually for every single account.

đź’ˇ The Fix

There is a native way to check expiration dates and force updates across your user list without needing a sprawling custom script. It saves you from having to check the shadow file manually every time a deadline looms.

chage -l username
chage -d 0 username

⚙️ Why It Works

By flipping the last password change date to zero, you effectively trick the system into thinking the user’s password expired the day the epoch started. The OS sees that as a mandatory prompt for a new password on the very next login attempt.

🚀 Pro-Tip: Use the -M flag with chage to set a strict max age so you don’t have to deal with this mess manually next year.

Linux Tips & Tricks | © ngelinux.com | 10/20/2026

0 0 votes
Article Rating
Exit mobile version