How to Force User To Change Its Password In Linux

If we want to ask a user to change its password after they login for the first time in Linux, there are two ways to do it. First using chage command with -d option. Use the following syntax to force a user to change their password at next logon on a Linux:
An example if we want to ask user ngoprek to change its password at next logon, so the syntax is:
The second way we can use passwd command with -e option. So, from the above example we use:
Then if the user login, the display will appear like this:
force password
The user must change its password before access the server and after changing its password, the user must login using its new password.

References:
thegeekdiary.com
cyberciti.biz

Leave a Reply

Your email address will not be published. Required fields are marked *