Wednesday, September 3, 2014

[Quick Tips] : Force linux user to change password upon login

Force linux user to change password upon login

Force linux user to change password upon login
In this tutorial we will learn how to force linux user to change the password upon login. There are two commands through which we can force user to change password upon first login or login.You can use any of the either command.
Note: Login as root to run these commands. If non-root user have sudo access then use sudo before these commands.
eg. sudo chage -d 0 user_name OR sudo passwd -e user_name
Command 1: By using chage command
Syntax:
Example: Here the user name is sharad
Command 2: You can also use passwd command
Syntax:
Example: Here the user name is sharad
After running any of the above given two commands.Logout and then login with user.On giving login password it will ask to reset new password.First give old password then give new password and reconfirm new password.(As per the message you will see on terminal or console)

No comments: