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:
The user must change its password before access the server and after changing its password, the user must login using its new password.