LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices

Reply
 
LinkBack Search this Thread
Old 09-29-2007, 08:40 AM   #1
ramesh.mimit
LQ Newbie
 
Registered: Nov 2006
Posts: 26

Rep: Reputation: 15
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
 
Old 09-29-2007, 08:44 AM   #2
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
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.
 
Old 09-29-2007, 09:51 AM   #3
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
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
 
Old 09-30-2007, 02:56 AM   #4
ramesh.mimit
LQ Newbie
 
Registered: Nov 2006
Posts: 26

Original Poster
Rep: Reputation: 15
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 View Post
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.
 
Old 10-01-2007, 10:09 AM   #5
chickenjoy
Member
 
Registered: Apr 2007
Distribution: centos,rhel, solaris
Posts: 200

Rep: Reputation: 30
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.
 
Old 10-01-2007, 01:58 PM   #6
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
Can you boot from any CD? Do you have a bootable Linux CD? What happens when you try to boot up?
 
Old 10-02-2007, 02:18 AM   #7
ramesh.mimit
LQ Newbie
 
Registered: Nov 2006
Posts: 26

Original Poster
Rep: Reputation: 15
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 View Post
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
 
Old 10-15-2011, 04:06 AM   #8
parry007
LQ Newbie
 
Registered: Oct 2011
Posts: 1

Rep: Reputation: Disabled
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.
 
Old 10-15-2011, 05:12 AM   #9
dive
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Slackware
Posts: 3,185

Rep: Reputation: 285Reputation: 285Reputation: 285
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
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How could normal user obtain root password or change root password ckamheng Debian 18 02-18-2009 10:28 PM
change Root Password even if the password in the grub is also set sheelnidhi Linux - General 6 08-30-2006 07:27 AM
How to reset root password without knowing the old one? rdelia Linux - Newbie 10 07-26-2006 03:31 PM
Change Root password on Grub 0.94 mikeshn Linux - General 5 03-10-2005 11:09 AM


All times are GMT -5. The time now is 06:52 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