Posts Tagged ‘chage’

How to force users to change their passwords on 1st login

Thursday, October 16th, 2008

1.) Firstly, lock the account to prevent the user from using the login until the change has been made:

# usermod -L <username>

2.) Change the password expiration date to 0 to ensure the user changes the password during the next login:

# chage -d 0 <username>

3.) To unlock the account after the change do the following:

# usermod -U <username>

The chage command

Thursday, July 17th, 2008

chage changes the number of days between password changes and the date of the last password change. This information is used by the system to determine when a user must change her password. The chage command is restricted to the root user, except for the -l option, which may be used by an unprivileged user to determine when her password or account is due to expire.

(more…)