Pages

Sunday, January 23, 2011

Forcing users to change their password upon first login

The chage command changes the number of days between password changes and the date of the last password change. This information is used by the sys
tem to determine when a user must change his/her password.

#chage -d 0 username

Set the number of since January 1st, 1970 when the password was last changed. The date may also be expressed in the format YYYY-MM-DD (or the format more commonly used in your area).

By using 0, we will automaticaly expire the passwd, forcing user to change it on first login.

How to force every new user to change password at first login


For this change we need to change the default setting of useradd command.

Look for the line or just append the following line in the file.

Expire=0



No comments:

Post a Comment