reset root password in CentOS 5.5
What are the steps that I must follow to reset the root password in CentOS 5.5?
|
Hi, welcome to LQ!
And what do you mean? as root Code:
passwd Done! Cheers, Tink |
Or boot on single mode
|
If one doesn't know the root password (has forgotten it) he won't be able to:
Quote:
Quote:
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) 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 Code:
mount Code:
cat /etc/fstab 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 |
Quote:
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. |
type in terminal
su root password type passwd |
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 |
Quote:
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.. |
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. |
Thank you Divyashree.
This is a new environment for me, and this method to change root's password was exactly what I needed. |
[QUOTE=firetech004;4387085]
Quote:
|
See post #8 ?
Did you leave a space? |
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. |