Change the Password in UNIX

by on September 12, 2010 · 1 comment· LAST UPDATED September 12, 2010

in

How do I change the password in UNIX?

To modify a user's password or your own password in UNIX use the passwd command. Open the terminal and then type the passwd command entering the new password, the characters entered do not display on screen, in order to avoid the password being seen by a passer-by. The passwd command prompts for the new password twice in order to detect any typing errors. The encrypted password is stored in /etc/shadow file.

UNIX Task: Change Any Users Password

Login as the root user and type the command:
# passwd userName
# passwd vivek
# passwd tom

Sample outputs:

Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully

UNIX Task: Change Your Own Password

Simply type the passwd command:
$ passwd
Sample outputs:

(current) UNIX password:
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
TwitterFacebookGoogle+PDF versionFound an error/typo on this page? Help us!

{ 1 comment… read it below or add one }

1 kris January 2, 2013 at 5:25 pm

Thanks…very useful

Reply

Leave a Comment

Tagged as: , , , , , ,

Previous Faq:

Next Faq: