{ 8 comments… read them below or add one }

1 Gautam kashyap April 23, 2009 at 10:00 pm

Hi ramesh,
this information is very useful for me .Thanks for publishing this article.

2 Neal April 24, 2009 at 12:36 pm

Thanks for all the good posts Ramesh/Dhineshkumar!

Another useful tip is to force users to change their password on next logon:

Just run “chage -d 0 “. This will unset the date the password was last changed and the account will require a new password on next logon. The message is something like “you are required to change your password (root enforced)”.

Great for new users as they get to choose their password.

3 Neal April 24, 2009 at 4:00 pm

Sorry that should have been :
chage -d 0 username
I must remember not to put things in brackets as they often vanish when submitted…

4 Ramesh Natarajan April 24, 2009 at 5:23 pm

@Gautam,
 
Thanks for your comments. I'm glad you found this article helpful.
 
@Neal,
 
Thanks a lot for the wonderful tip. For those who are interested, I've copy/pasted the output of the command suggested by Neal. i.e Following is the easy way to force users to change their password when they login. Please note that the "Last password change" value is changed to "password much be changed" after the chage -d 0.

# chage -l jsmith
Last password change                                    : Apr 23, 2009
Password expires                                        : never
Password inactive                                       : never
Account expires                                         : never
Minimum number of days between password change          : 0
Maximum number of days between password change          : 99999
Number of days of warning before password expires       : 7

# chage -d 0 jsmith

# chage -l jsmith
Last password change                                    : password must be changed
Password expires                                        : never
Password inactive                                       : never
Account expires                                         : never
Minimum number of days between password change          : 0
Maximum number of days between password change          : 99999
Number of days of warning before password expires       : 7
5 reaky May 20, 2009 at 6:22 am

V Good explaination, But I have a question,
How Can I change the expiration warining message for chage command ???

6 rmarquez June 9, 2009 at 12:05 am

I have a question. When a user in Linux wants to change their password, it won’t let them use a word based on a dictionary reference. Yet, as root it complains, but changes. What can I look at to determine why it won’t let a user change their own password if it’s a “dictionary” word? How can I put it back to where a user can change their password to whatever they want?

7 Mattias July 20, 2009 at 2:30 am

What repository is it available in? I can’t find it in neither etch nor lenny, main contib non-free..

8 Umer Asghar May 26, 2010 at 12:53 am

Very nice explanation

Leave a Comment

Previous post:

Next post: