LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 10-14-2010, 08:40 PM   #1
leekin
LQ Newbie
 
Registered: Aug 2007
Posts: 2

Rep: Reputation: Disabled
reset root password in CentOS 5.5


What are the steps that I must follow to reset the root password in CentOS 5.5?
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 10-14-2010, 08:44 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,978
Blog Entries: 11

Rep: Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879
Hi, welcome to LQ!

And what do you mean?

as root
Code:
passwd
Enter new password twice (thrice if it's poor).

Done!



Cheers,
Tink
 
Old 10-14-2010, 09:11 PM   #3
leejohnli
Member
 
Registered: Sep 2010
Posts: 58

Rep: Reputation: 2
Or boot on single mode
 
Old 10-15-2010, 01:37 AM   #4
fiku
LQ Newbie
 
Registered: Oct 2010
Posts: 25

Rep: Reputation: 2
If one doesn't know the root password (has forgotten it) he won't be able to:
Quote:
as root
Code:
passwd
Quote:
Originally Posted by leejohnli View Post
Or boot on single mode
In Ubuntu 9.10 (and higher) to login on single-mode You also have to know the password, don't know if in CentOS too.


So... You can boot live-cd (e.g. Ubuntu Live-CD)

mount the root drive with Your current system, e.g.: (as root)
Code:
whoami  #the answer should be root)
mkdir /restore_root
mount /dev/sda1 /restore_root
Tip:
If You don't know on what partition You have the system root, check it on Your current system (not the live-cd one) with:
Code:
df -h
or
Code:
mount
or
Code:
cat /etc/fstab
After mounting the root device:
this command will, sort of, log-in to Your system from Live-Cd (You will literally, change root system (mount point))
Code:
chroot /restore_root
passwd root #You will be prompt to change the passwd
 
Old 10-15-2010, 01:47 AM   #5
divyashree
Senior Member
 
Registered: Apr 2007
Location: bbsr,orissa,India
Distribution: RHEL5 ,RHEL4,CENT OS5,FEDORA,UBUNTU
Posts: 1,347

Rep: Reputation: 135Reputation: 135
Quote:
Originally Posted by leekin View Post
What are the steps that I must follow to reset the root password in CentOS 5.5?
Just restart your machine and follow the steps:

1. At the boot(grub) menu select the linux kernel

2. then press e

3. Go to the end of the line

4. add 1 or S or Single at the end of the line

5. press enter

6. press b on the line to boot from that line

7. Now the root prompt will come

8. run the command 'passwd' and it will ask you to change your password for root

And thats all . And if any problem just post it here.
 
5 members found this post helpful.
Old 10-15-2010, 01:49 AM   #6
aries_baluyot
Member
 
Registered: Oct 2010
Location: India
Distribution: Mandriva, Suse, Ubuntu, Centos, Maemo, Omnia Xp
Posts: 86

Rep: Reputation: -11
type in terminal

su

root password

type

passwd
 
0 members found this post helpful.
Old 10-15-2010, 10:11 AM   #7
leekin
LQ Newbie
 
Registered: Aug 2007
Posts: 2

Original Poster
Rep: Reputation: Disabled
Wink resolved

divyashree provided exactly what I was hoping for. Booting in single mode enable me to reset the root password.

Thanks to all of you for responding.

Leekin
 
1 members found this post helpful.
Old 05-03-2011, 05:38 PM   #8
Spyisra
LQ Newbie
 
Registered: May 2011
Posts: 1

Rep: Reputation: 0
Quote:
Originally Posted by divyashree View Post
Just restart your machine and follow the steps:

1. At the boot(grub) menu select the linux kernel

2. then press e

3. Go to the end of the line

4. add 1 or S or Single at the end of the line

5. press enter

6. press b on the line to boot from that line

7. Now the root prompt will come

8. run the command 'passwd' and it will ask you to change your password for root

And thats all . And if any problem just post it here.
I just registered to this site so I can say Thanks you! This was very helpful!

I do wish to clarify, that at point 4. where you need to add the S at the end of the line, make sure to also make a space before the S. I did that wrong at my first try, then figured it out !!
Thanks again..
 
Old 06-15-2011, 09:16 PM   #9
firetech004
LQ Newbie
 
Registered: Jun 2011
Posts: 1

Rep: Reputation: Disabled
Smile Thank you!!

[QUOTE=divyashree;4128021]Just restart your machine and follow the steps:

1. At the boot(grub) menu select the linux kernel

2. then press e

3. Go to the end of the line

4. add 1 or S or Single at the end of the line

5. press enter

6. press b on the line to boot from that line

7. Now the root prompt will come

8. run the command 'passwd' and it will ask you to change your password for root

And thats all . And if any problem just post it here.

Awesome it worked for me as well. Thank you so much. Very helpful Save me from having to reinstall.
 
Old 08-14-2011, 09:44 PM   #10
algerdes
LQ Newbie
 
Registered: Sep 2009
Location: Illinois
Posts: 5

Rep: Reputation: 0
Thank you Divyashree.
This is a new environment for me, and this method to change root's password was exactly what I needed.
 
Old 12-06-2012, 08:20 AM   #11
abok
LQ Newbie
 
Registered: Dec 2012
Posts: 1

Rep: Reputation: Disabled
[QUOTE=firetech004;4387085]
Quote:
Originally Posted by divyashree View Post
Just restart your machine and follow the steps:

1. At the boot(grub) menu select the linux kernel

2. then press e

3. Go to the end of the line

4. add 1 or S or Single at the end of the line

5. press enter

6. press b on the line to boot from that line

7. Now the root prompt will come

8. run the command 'passwd' and it will ask you to change your password for root

And thats all . And if any problem just post it here.

Awesome it worked for me as well. Thank you so much. Very helpful Save me from having to reinstall.
Done all the steps 1 to 4, but when I boot the command prompt does not come instead it boots as usual and requires the root login password to be entred
 
Old 12-06-2012, 11:25 PM   #12
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,269

Rep: Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028
See post #8 ?
Did you leave a space?
 
Old 12-07-2012, 03:18 AM   #13
adol83
Member
 
Registered: Jul 2012
Location: Rome
Distribution: RHEL6, CentOs
Posts: 92

Rep: Reputation: 1
I've got two suggestions for the experience i had maybe would be useful,

1 - Not anytime the keyboard is mapped the same as you boot usually when you boot in single user mode so the password could be different because you can't see. Check typing any special character of your password if that match with the keyboard map. Check your keyboard settings.

2 - If you're using VMWARE check you have not a boot from live-cd and you have not any live-cd inserted. That could be a reason for the system keep asking you the password.

Have a good day.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Reset Root password hbenway AIX 9 08-19-2008 04:13 PM
How to retrieve( or reset) root password in Mandrake Linux, as I forgot my password? Reghunath Linux - Software 4 05-08-2008 04:11 AM
reset root password powah Linux - Security 5 09-15-2006 01:30 PM
reset root password kapslock Debian 14 07-27-2006 07:08 AM
Reset Root password sdsouza Linux - Software 5 11-12-2003 04:50 PM


All times are GMT -5. The time now is 01:35 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration