Force User to Change Password At first Login On CentOS 7

We can force the user to change their password at first login in Linux and can set a password using passwd command. There is a way to force the user to change their password at first login to the system. This can be done with the ‘–d‘ option.

chage command used to configure a password expiry from the shell prompt followed by many options available.

Check Out: How To Install Memcached Memory Caching In Linux

Force User To Change At first log in:

You can manage user password policy using the below command to force.

The syntax is chage –d 0 username

We have created a user with a test and password.

useradd test

Force User to Change

passwd test

Check Out: Find Out Why GET Command Not Found Installed In Linux

Now, run the below command to force the user.

chage –d 0 test

After this command user will have to change the password at first login. You can also use the ‘-e‘ option as well.

After putting an old password it will jump to ask you to change the current password as shown in the figure.

Finally, the password changed.

That’s it. passwd force  user change password linu change user password linux

Share on:

I'm the founder of Curious Viral. I hope this blog will provide you complete information about Linux Technology & I would like to share my technical knowledge with you which I have learned during this period.

Other Posts You May Like...

Leave a comment