Force Linux Users to Change Their Password at Next Login
This guide explains how system administrators can require Linux users to reset their passwords on the next login by adjusting the minimum password age with chage or expiring the password using the passwd command, and provides step‑by‑step instructions.
Step 1: Set Minimum Password Age to Zero
Linux password policies are managed with the chage command, which controls parameters such as minimum days, maximum days, and warning period. Setting the minimum days to zero allows a user to change the password at the next login.
sudo chage -m 0 usernameReplace username with the actual account name. After running this command the user will be able to modify the password when they log in next.
Step 2: Expire the Password Immediately
Another method is to force a password change by expiring the current password. The passwd -e command marks the password as expired, so the user must set a new one before gaining access.
sudo passwd -e usernameAgain, substitute username with the target account. After execution the user will be prompted to create a new password at the next login.
Executing the Commands
Both approaches achieve the same goal. Follow these steps to apply the change:
Open a terminal and log in with administrative privileges.
Select the user account whose password you want to enforce a change for.
Choose a method:
Use passwd -e for an immediate password expiration.
Use chage -m 0 if you prefer to set a minimum age of zero days.
Run the chosen command, verify no errors are reported, then close the terminal.
Conclusion
Forcing password changes is a vital part of Linux security. Administrators can either expire the password with passwd -e or set the minimum password age to zero using chage -m 0 . While this improves security, it should be balanced against user convenience; frequent forced changes may disrupt workflow.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Liangxu Linux
Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
