LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Red Hat (http://www.linuxquestions.org/questions/red-hat-31/)
-   -   how to change root password without knowing the grub password (http://www.linuxquestions.org/questions/red-hat-31/how-to-change-root-password-without-knowing-the-grub-password-588196/)

ramesh.mimit 09-29-2007 08:40 AM

how to change root password without knowing the grub password
 
hi friends is there anybody who knows how to change the root password or get the root level access without knowing the root password and also i don't know grub password also and one thing more rescue environment is also not working. but i have physical access to my machine.

please let me know if anybody knows the solution.

all the solutions and suggestions will be appreciated.



Thanks & Regards
Ramesh Kumar

jschiwal 09-29-2007 08:44 AM

You would need to access the root partition with a rescue disk or a live distro so that you bypass the grub password. Then mount the root partition and zero the root password. Reboot and su to root (no password now) and run "passwd" to change it.

pixellany 09-29-2007 09:51 AM

Boot from any live CD, and mount the Linux partition which contains /etc. Edit the "passwd" file to remove the first "x" in the entry for root. The new entry will look something like this:
root::0:0:root:/root:/bin/bash
You will now be able to log in as root with no password.

While you are at it, you can edit /boot/grub/menu.lst to disable the GRUB password

ramesh.mimit 09-30-2007 02:56 AM

thanks for giving me the solution
 
thanks for giving me the solution but i have one more problem is that rescue environment is not working also what will be the sol. now

i have only admin user access plz tell me if u have any idea in yr mind.



Thanks & regards
Ramesh Kumar





Quote:

Originally Posted by jschiwal (Post 2907475)
You would need to access the root partition with a rescue disk or a live distro so that you bypass the grub password. Then mount the root partition and zero the root password. Reboot and su to root (no password now) and run "passwd" to change it.


chickenjoy 10-01-2007 10:09 AM

What do you mean by the rescue environment not working? your description is too vague. Rescue environment is when you boot to the 1st installation cd of your os and when it prompts you to enter a mode for installation; you type in "linux rescue" and then just follow the instructions.

pixellany 10-01-2007 01:58 PM

Can you boot from any CD? Do you have a bootable Linux CD? What happens when you try to boot up?

ramesh.mimit 10-02-2007 02:18 AM

i got the solution
 
i got the the solution man by theway thanks a lot for giving me such suggestions.

byee



Quote:

Originally Posted by pixellany (Post 2907533)
Boot from any live CD, and mount the Linux partition which contains /etc. Edit the "passwd" file to remove the first "x" in the entry for root. The new entry will look something like this:
root::0:0:root:/root:/bin/bash
You will now be able to log in as root with no password.

While you are at it, you can edit /boot/grub/menu.lst to disable the GRUB password


parry007 10-15-2011 04:06 AM

passwd unable to make changes
 
When changes are made to passwd file... it doesnt save the file .. i tried to add ! after commands but doesnt work. plz reply.

dive 10-15-2011 05:12 AM

if you chroot into the mounted system you can just run passwd:

Boot from CD
mkdir /hdd
mount /dev/sdxx /hdd
chroot /hdd
passwd
exit
reboot


All times are GMT -5. The time now is 08:22 PM.