Linux Classes
Share This With a Friend  
LINUX CLASSES - LINUX COMMANDS

Linux Change Password

How Do I Change my Linux Password?

You can use the passwd command to change your log-in password, and as you can tell from the man output shown in the preceding section, you have quite a few options. Here are some of the most common:
passwd   Change your own password.

passwd sleepy   Change sleepy's password.

passwd -d sleepy   Delete sleepy's password.

When you enter one of these commands to change a password, you will be prompted for the old (current) password and a new password. Your new password should be at least six characters long and not too easy for someone else to guess. Oh, and writing it down on a scrap of paper taped to your monitor is not recommended either. :-)

If you share your Linux system with multiple users, or if you have a dial-in modem attached, password security for each account is particularly important. But if you're the only one who will ever lay a finger on your system, you might want to delete your password, thus removing the need to enter it each time you log in. It's your call, but you never know when your five-year-old will wander by the keyboard!

By the way, you might get the idea from the preceding commands that users can go around changing each other's passwords at will, but that's not the case. Only a superuser (such as root) can change or delete another user's password.

For more information on the passwd command, see the passwd manual.

Previous Lesson: Important Linux Commands
Next Lesson: Switching Users

[ RETURN TO INDEX ]


   

Comments - most recent first
(Please feel free to answer questions posted by others!)

Vignesh     (07 Jan 2013, 19:50)
How can i make the system to ask for a password change before a user starts working with the root specified(given) password so that user can login with his own password next time....
Charles     (05 Jan 2013, 01:13)
Hello,

Everytime I logon to my linux servers, it ask's me to change my pw. How do I avoid this from happenning? I don't have this issue on Solaris servers.

Thanks
TARCISIUS MCHAMI     (25 Nov 2012, 05:07)
How can I install other microsoft-compatible softwares such as dictionary in Linux
sanjeeb     (23 Apr 2012, 09:47)
Hi All,

We are in a process of changing the Linux server password. We have used "passwd" command and successfully change the password. we have changed the password 3 times and all attempts are successfully executed. Now we want to make the password as it was there previously. when we are chnaging to old password, teh change is not happening and the error is coming as "BAD PASSWORD: has been already used"..Please help
del     (15 Apr 2012, 04:36)
hi Sir bob could you please explian how to download a file example firefox and how to exreactthe file or any file after download iam using debian

Once again thank you Mr BOb
Love Magesh     (28 Mar 2012, 16:53)
Tnx
Mike Murphy     (05 Mar 2012, 06:24)
well done, quick and to the point. Just what I needed.
Alex     (18 Feb 2012, 12:46)
hi,Bob
Thank you for your articles.
Now,I have a bother like that when i enter the "passwd" command in linux,then on the next line will show the promopt text like that "New Password", and now if i want to get the promopt text and what can i do for the goal.
kashyap     (17 Feb 2012, 09:47)
i can not install google chrome
Tim C     (16 Oct 2011, 15:55)
@Sunny, Hi Sunny, this is Tim

Took care of that one too... I'm on a roll...(whew) this is hard work!
sunny     (15 Oct 2011, 12:07)
hi this is sunny
Bob Rankin     (04 Oct 2011, 15:23)
@mohammad - If you don't have the root password, you can't change it.
mohammad     (04 Oct 2011, 10:03)
how can i prevent the others to change root password ?
Majed     (08 Aug 2011, 08:21)
@Vishal P, well he said that it does delete the password or are you too afraid to try it?
Vishal P     (07 Jun 2011, 02:12)
is it possible to delete password of any user using following commands:-
passwd -d "username"
Anuran Halder     (09 May 2011, 05:32)
i want to know how my passwd would expire after some time
Rambabu D     (09 Jan 2011, 22:51)
i am installed fedora12 i want practice user and admin commands some commands is not working pls tell me whhich window i am practicing unix commands. terminal window is not supporting to all commands.
Thomas Diaz     (17 Dec 2010, 10:58)
the command doesnt work! how do i change my password??
pleas help me
Manoj     (12 Dec 2010, 02:13)
r changing the Super User Password Go into single mode and change the root password.
Cab114     (09 Dec 2010, 15:36)
Hmm, maybe this has to do with the roblox thing.
JJ     (01 Nov 2010, 12:53)
@Jeff LOL, "found" a laptop/PC on your doorstep! Stop stealing, dude :P
rcmichelle     (12 Oct 2010, 05:20)
Last time I forgot my password and tried everything i could do but failed, until I found this great tool Windows Password Software. It works great, and you can google it.you can try to google it.
Craig     (17 Sep 2010, 22:52)
@Jeff
Download some new linux discs of whatever flavor you want. Ubuntu is really easy. Others may be just as easy. Burn the ISO(s) to DVD/CD. Put them in, restart computer and make sure your BIOS is set to boot to DVD/CD device first. Follow instructions from linux installer. Enjoy your new Linux installation.
Jeff     (10 Sep 2010, 14:09)
I recently received a comp as a "gift" from an unknown person(left on doorstep). It has a Linux system. I am a Linux Virgin. It is asking for a username and a password. I have NO IDEA what they would be. Is there a way to bypass this or a way to get the username and password changed? Any HELP from ANYONE would be helpfull.
Ks     (26 Aug 2010, 00:12)
Thank you so much, it helped me.
mounisha     (26 Jul 2010, 13:38)
how to change a password? what are septs?
Somu     (09 Jul 2010, 08:20)
suppose a user forgot his password and he asking the admin to change the password then what are the steps should be followed by the admin and what are the different ways of changing it could u please mail me out
sureshbvn     (25 Jun 2010, 10:28)
you have another soloution in changin the password of superuser.
restart the system
press any key while booting
it takes to you have a screen
select required ie kernel
press b
you will get a terminal
you can directly log in as superuser
using passwd command you can change
sureshbvn     (25 Jun 2010, 10:26)
you cannot see the password.
instead you can change the password.
log in as single user.
you can do this by init 1 which shutdowns the
networking.
now u can login as single user.
change the password by passwd+enter
give the password


ezat     (25 Jun 2010, 08:38)
change my password
Raghavendra     (24 Jun 2010, 21:46)
i am a account in administrator . i don't know my adminstrator password how to know my administrator password
suresh     (10 Jun 2010, 12:19)
just use passwd and press enter.
it will ask for new password.
enter it two times.
Aniket Kulkarni     (10 Jun 2010, 04:48)
For changing the Super User Password Go into single mode and change the root password.
patricia     (09 Jun 2010, 20:00)
@Kanya:

$ sudo su
***prompt will change***
# passwd
# exit
Kanya     (08 Jun 2010, 22:27)
I can not change password Linux
Bob Rankin     (05 Apr 2010, 07:19)
Login as the superuser, then use the passwd command.
Mahesh Narayan     (10 Mar 2010, 05:53)
how to change super user password

I welcome your comments. However... I am puzzled by many people who say "Please send me the Linux tutorial." This website *is* your Linux Tutorial! Read everything here, learn all you can, ask questions if you like. But don't ask me to send what you already have. :-)

NO SPAM! If you post garbage, it will be deleted, and you will be banned.
*Name:
Email:
Notify me about new comments on this page
Hide my email
*Text:
 
 


Ask Bob Rankin - Free Tech Support


Copyright © by - Privacy Policy
All rights reserved - Redistribution is allowed only with permission.