Change a user password in Solaris

To change a user’s password, you must either know the existing password or have superuser (root) access to the system. If you know the user’s password and are logged in as that account, simply follow these steps:

passwd
passwd: Changing password for qmchenry
Enter login password: {OLD_PASSWORD}
New password: {NEW_PASSWORD}
Re-enter new password: {NEW_PASSWORD}
passwd (SYSTEM): passwd successfully changed for qmchenry

After starting the passwd program, you will be prompted to enter the current password {OLD_PASSWORD}, then to enter the new desired password twice {NEW_PASSWORD}. If there is a problem such as new passwords not matching, new password too similar to the old password, or other issues, passwd will let you know with an error message and will usually ask you to try again.

If you have superuser access to the system, you can change any password without knowledge of the existing password (which is very handy when users forget their passwords since it is nontrivial to reclaim a hashed password). As root, run the same program (passwd) and follow the instructions. The only differences are that you need not enter the existing password and many errors will become warnings because the program will let root do what root wants (even if it is a bad idea).

The Conversation

Follow the reactions below and share your own thoughts.

9 Responses to “Change a user password in Solaris”

  1. October 15, 2008 at 5:39 am, Mick said:

    Thanks for your article

    Reply

  2. October 29, 2008 at 11:47 am, R K Mohanta said:

    In one of server SAS ETL is installed and all libname are using that user id and password so how i will change this without down time

    Reply

  3. December 02, 2009 at 7:20 pm, Bob said:

    For changing password as a super user, run the command passwd ‘username’

    Reply

    • February 09, 2010 at 2:29 pm, Anonymous said:

      how to restrict the user for changing the password

      Reply

  4. February 09, 2010 at 2:14 pm, Anonymous said:

    if i am the superuser how to restrict the user to change the password

    Reply

  5. February 09, 2010 at 2:15 pm, Anonymous said:

    if i am superuser then how to restrict the normal users to
    changing the password

    Reply

  6. June 23, 2010 at 2:34 pm, suresh said:

    i want to delete the user password ,what is the command in solaris

    Reply

  7. December 07, 2011 at 2:17 am, Yasir said:

    I used the command passwd but after asking for new password two times it gives the message” permission denied “

    Reply

  8. May 17, 2012 at 3:12 pm, ram said:

    how will create password less user on solaris

    Reply

Leave a Reply