Linux change password on next login

 

By using change command we can force a user to change password on first login or next login.

Syntax:

chage -d 0 <UserName>

Example:

Here I am using trying to change ‘tom’ users password on next/first login.

$ change -d 0 tom

-d 0: By setting it to zero, we are going to force user to change password on next/first login.