How do I force linux to change (forcefully) user password?

passwd command changes passwords for user accounts. A normal user may only change the password for his/her own account, while the super user may change the password for any account. passwd also changes account information, such as the full name of the user, the user’s login shell, or his/her password expiry date and interval.

If you wish to immediately expire an account’s password, you can pass the -e option to passwd command. This in effect can force a user to change his/her password at the user’s next login.

Let us assume user name is raj, then login as root user and type following command:

# passwd -e raj

Next time when raj tries to login
server login:raj
Password:
You are required to change your password immediately (root enforced)
Changing password for raj
(current) UNIX password:
Enter new UNIX password:
Retype new UNIX password:
Linux debian 2.6.13 #2 Sun Oct 2 20:07:57 IST 2005 i686 GNU/Linux

Last login: Thu Oct 6 01:24:15 2005

Author: admin

I like chocolate, gadgets, open source software, photography, traveling and all shades of green colors. I love spending time with fun loving friends and family members. This is my own online journal.

4 thoughts on “How do I force linux to change (forcefully) user password?”

  1. Pingback: links for 2007-05-14 « Donghai Ma
  2. and then it says i need to wait longer to change it and then it tells me to put in my username

  3. Can this work over NIS?
    Also, how does it work in GUI?
    Any ideas there? I will try it in a day or two. If I can get some response before that, it’d be nice.

Leave a Reply

Your email address will not be published. Required fields are marked *