Stop password-protected user accounts from being an absolute nightmare

User & Group Management

Stop password-protected user accounts from being an absolute nightmare

🧩 The Challenge

Dealing with a service account or an old user that has an expired password is the worst kind of surprise on a Monday morning. Nobody remembers the password, and you are stuck fumbling with command line flags just to clear the lock without nuking the account entirely.

💡 The Fix

Use chage to effectively bypass the password aging rules so you can stop babysitting these accounts for good. It keeps the account active while letting you focus on the stuff that actually matters.

sudo chage -M -1 -E -1 username

⚙️ Why It Works

By setting the maximum password age and the expiration date to negative one, you are essentially telling the shadow file to ignore any aging constraints. The user stays enabled indefinitely, saving you from those annoying login failures that happen at the most inconvenient times.

🚀 Pro-Tip: Check your existing settings with chage -l username first, otherwise you’re just stabbing in the dark.

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

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted