How do I change passwords for specific user account under Linux operating systems using command line?
You need to use the passwd command to change passwords.
Rules for changing passwords for user accounts
- A normal user may only change the password for his/her own account
- The superuser (root user) may change the password for any account or specific account.
- 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 userNameHer
To change the password for user called vivek, enter:
# passwd vivek
Sample outputs:
To see password status of any user account, enter:
# passwd -S userNameHere
# passwd -S vivekSample outputs:
vivek P 05/05/2012 0 99999 7 -1
The status information consists of 7 fields as follows:
- vivek : Account login name (username)
- P : This field indicates if the user account has a locked password (L), has no password (NP), or has a usable password (P)
- 05/05/2012 : Date of the last password change.
- 0 : Password expiry minimum age
- 99999 : Password expiry maximum age.
- 7 : Password expiry warning period.
- -1 : Inactivity period for the password (see chage command for more information).
To get more info about password aging for a specific user called vivek, enter:
# chage -l vivek
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012

- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop














{ 3 comments… read them below or add one }
passwd
U will prompted for password and U can change it! If you are doing it for somebody else, U need to be root!
Tried same, below is output, didn’t got “PS”
[root@externvlab1280 ~]# passwd -S bhushan
bhushan PS 2012-10-11 10 90 7 -1 (Password set, SHA512 crypt.)
itsssssssssss helps me at a valid time