HowTo: Change Password of Specific User Account In Linux

To change a password on behalf of a user, first sign on or “su” to the “root” account. Then type, “passwd user” (where user is the username for the password you are changing). The system will prompt you to enter a password. Passwords do not echo to the screen when you enter them.

You can also change your own password, by typing “passwd” (without specifying a username). You will be prompted to enter your old password for verification, and then a new password.


How do I change passwords for specific user account under Linux operating system using the command line?

You need to use the passwd command to changes the user’s password.

Rules for changing passwords for user accounts

  1. A normal user may only change the password for his/her own account.
  2. The superuser (root user) may change the password for any account or specific account.
  3. The passwd command also changes the account or associated password validity period.

First, login as the root user. Use sudo -s or su - command to login as root. To change password of specific user account, use the following syntax:

passwd userNameHere

To change the password for user called vivek, enter:
# passwd vivek
Sample outputs:

Change Users Local Linux Password Command Line

To see password status of any user account, enter:
# passwd -S userNameHere
# passwd -S vivek

Sample outputs:

vivek P 05/05/2012 0 99999 7 -1

The status information consists of 7 fields as follows:

  1. vivek : Account login name (username)
  2. P : This field indicates if the user account has a locked password (L), has no password (NP), or has a usable password (P)
  3. 05/05/2012 : Date of the last password change.
  4. 0 : Password expiry minimum age
  5. 99999 : Password expiry maximum age.
  6. 7 : Password expiry warning period.
  7. -1 : Inactivity period for the password

To get more info about password aging for a specific user called vivek, enter:
# chage -l vivek

Chage command