I have to create multiple users for my project and force the users to change the password when they login to the system for the first time.
To create a user in linux,
Now set a temporary password for the user
To force the user to change the password on first login, you can force expire the password of the user by using the same
passwd command. Although the
passwd command is used to change the password of a user it supports a special flag to force expire the users password.
passwd --expire <yourusername>
passwrd --expire joe