In this tutorial, you will learn about forcing a user to change their password in Linux. Also will discuss the content stored in the shadow file.

Force User to Change Password

We use passwd command to create or change user passwords in Linux systems. It also allows us to expire any user’s password. Once the password is expired, the system will allow users to log in but force them to change their password before getting the shell access. You can view user account and password details run below command as sudo privileges account: To expire users password, type: Replace “username” with the actual user name of your system.

These commands updates the entries in /etc/shadow file.

How to Force User to Change Password at Next Login in Linux   TecAdmin - 52