How to force a user to change their password at the next login in linux?



  • # /usr/bin/chage -d 0 testuser
    

    When the user testuser next logs in, after they enter their original password, they will be prompted to change it:

    login as: testuser
    [email protected]'s password:
    You are required to change your password immediately (root enforced)
    Last login: Mon Jul 20 14:18:08 2009 from unknown-00-aa-bb-cc-dd-ee.home
    WARNING: Your password has expired.
    You must change your password now and login again!
    Changing password for user testuser.
    Changing password for testuser
    (current) UNIX password:
    New UNIX password:
    Retype new UNIX password:
    

    After retyping the new password the second time, the login window will disappear. When opening a new putty session, the user will need to enter their new password to log in.


Log in to reply
 

© Lightnetics 2024