Click to See Complete Forum and Search --> : Software:Howto: Recover Root Password
adrians
04-23-2004, 12:27 PM
Ok I did a stupid thing.... I just finished installing SuSE 9.0 in my laptop by ftp, it took all night. So when it finished downloading all packages I gave my root pass, which I thought well lets give it an easy but hard to guess password and I did... then it asked me if I wanted to download some updates of drivers and stuff so I did and it took another hour or two. So downloading packages is done till here....
Now, the problem is I created my user account and everything, but i forgot my root password :(:confused: and now I can't log as super user to install software and stuff....
Is there anyway to find out or reset my root password without having to reinstall which would again take for ever?
thanks, kinda stupid huh?
adrians
04-23-2004, 12:31 PM
I remembered my password!!! but its good to know for another time though... Any suggestions?
scinerd
04-23-2004, 12:39 PM
the easy way to do this is boot the machine up in single user mode.
Since you can log in you might be able to do "init s" but I have never done it that way.
most of the time you send a opion to you boot loader
Lilo:
when you get to the boot prompt type "linux single" This will boot to a prompt where you are logged in as root.
grub:
hightlight your kernel line and type e to edit.
go to the line that starts with kernal select e again to edit and add "<space> single" to the end
hit enter and then b for boot
XiaoKJ
04-23-2004, 12:42 PM
there is a linux distro named tomsrtbt for that matter.
It is really Tom's Root Boot, shortened to tomsrtbt, which is a floppy based distro for doing special tasks.
I forgot the specific method for doing it, but I suppose there is documentation on the site. I found out about linux and distros with www.linux.org and you can search for distros by clicking "distributions".
mdwatts
04-23-2004, 01:53 PM
From a text file I have saved (likely from here).
Forgotten Password
Help! I forgot my root password. How do I log in now?
You can log in using single-user mode and create a new root password.
To enter single-user mode, reboot your computer. If you use the default boot loader, GRUB, you can enter single user mode by performing the following:
1.
At the boot loader menu, type [e] to enter into editing mode.
2.
You will be presented with a boot entry listing. Look for the line that looks similar to the following:
kernel /vmlinuz-2.4.18-0.4 ro root=/dev/hda2
Press the arrow key until this line is highlighted and press [e].
3.
Press the Spacebar once to add a blank space, then add the word single to tell GRUB to boot into single-user Linux mode. Press [Enter] to make the editing change take effect.
4.
You will be brought back to the edit mode screen. From here, press [b] and GRUB will boot single-user Linux mode. After it finishes loading, you will be presented with a shell prompt similar to the following:
sh-2.05#
5.
You can now change the root password by typing
bash# passwd root
You will be asked to re-type the password for verification. Once you are finished, the password will be changed. You can then reboot by typing reboot at the prompt; then you can log in to root as you normally would.
adrians
04-23-2004, 02:12 PM
I did what you told me (using grub) but i had to get around it a little, pressing [e] wont edit the the line as you said, it showed nothing, so what i did is just add single in the blank space below and i think it worked...
The only thing is that when its starting up it asks me for my old root password, so i guess it doesnt work. for lost passwords or maybe im doing something worng
mdwatts
04-23-2004, 03:09 PM
Sorry as I forgot you are using SuSE 9.0.
At the initial Grub screen you will see a commandline at the bottom, so enter a 1 there before the timer times out and then press enter. That should get you to single mode.
adrians
04-23-2004, 03:36 PM
thats the same as typing single and still asks for a root password
mdwatts
04-23-2004, 04:26 PM
Originally posted by adrians
thats the same as typing single and still asks for a root password
Sorry as I've never had the need to recover my root password and I thought those instructions would work.
Try these G4L search results for 'recover root password' (http://www.google.com/linux?hl=en&lr=&ie=UTF-8&oe=UTF-8&q=recover+root+password&btnG=Google+Search). You'll see there are some for Redhat and SuSE. Hopefully you will find the solution.
terribleRobbo
04-24-2004, 09:49 AM
I usually use Damn Small Linux or Knoppix to boot up, then:
mount /dev/yourrootdrivehere /mnt/yourrootdrivehere
chroot /mnt/yourrootdrivehere
passwd
(Type new password twice.)
[Ctrl-D]
reboot
keyshawn
04-24-2004, 01:08 PM
Originally posted by mdwatts
From a text file I have saved (likely from here).
I noticed this question has been asked numerous times before my newbs on here and other linux boads.
How about moving this thread to the Just-Linux Help files library ?