LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   reset root password in CentOS 5.5 (https://www.linuxquestions.org/questions/linux-newbie-8/reset-root-password-in-centos-5-5-a-838143/)

leekin 10-14-2010 08:40 PM

reset root password in CentOS 5.5
 
What are the steps that I must follow to reset the root password in CentOS 5.5?

Tinkster 10-14-2010 08:44 PM

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

leejohnli 10-14-2010 09:11 PM

Or boot on single mode

fiku 10-15-2010 01:37 AM

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 (Post 4127811)
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


divyashree 10-15-2010 01:47 AM

Quote:

Originally Posted by leekin (Post 4127780)
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.

aries_baluyot 10-15-2010 01:49 AM

type in terminal

su

root password

type

passwd

leekin 10-15-2010 10:11 AM

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

Spyisra 05-03-2011 05:38 PM

Quote:

Originally Posted by divyashree (Post 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.

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..

firetech004 06-15-2011 09:16 PM

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.

algerdes 08-14-2011 09:44 PM

Thank you Divyashree.
This is a new environment for me, and this method to change root's password was exactly what I needed.

abok 12-06-2012 08:20 AM

[QUOTE=firetech004;4387085]
Quote:

Originally Posted by divyashree (Post 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.

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

chrism01 12-06-2012 11:25 PM

See post #8 ?
Did you leave a space?

adol83 12-07-2012 03:18 AM

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.


All times are GMT -5. The time now is 07:15 PM.