Force Users to Change Their Linux Password on Next Login

Learn how to enforce password changes for Linux users by adjusting the minimum password age with chage or expiring the password using passwd, ensuring stronger security while providing clear step‑by‑step commands and execution guidance.

Liangxu Linux
Liangxu Linux
Liangxu Linux
Force Users to Change Their Linux Password on Next Login

Introduction

Password management is a crucial part of maintaining Linux system security. Administrators often need to require users to change their passwords at the next login.

Step 1: Set Minimum Password Age to Zero

Use the chage command to modify password policy parameters. Setting the minimum number of days to zero allows the user to change the password immediately on next login.
sudo chage -m 0 username

Replace username with the actual account name. After running this command, the user can change the password at the next login.

Step 2: Expire the Password

Alternatively, force an immediate password change by expiring the current password with the passwd command. The user must set a new password before they can log in again.
sudo passwd -e username
Again, substitute username with the target account. Once executed, the user is required to change the password on the next login.

Execution Procedure

Open a terminal and log in with administrative privileges.

Select the user account that needs a forced password change.

Choose the preferred method: use passwd -e for an immediate change, or chage -m 0 to allow the user to change the password after a configurable period.

Apply the command, verify the change, and close the terminal.

Conclusion

Forcing password changes enhances Linux system security. Administrators can use either passwd -e to expire the password instantly or chage -m 0 to set the minimum age to zero. While regular password updates improve security, they should be scheduled sensibly to avoid unnecessary user inconvenience.
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

LinuxSecuritySystem AdministrationPassword Managementpasswdchage
Liangxu Linux
Written by

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.)

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.