Need to recover or change root password. And must run "nano".
I hate these darn laptop keyboards! I typed my password very carefully, but yet I must have typed it wrong.
I tried booting from the install DVD, but I don't really know where to find (or how to distinguish) the filesystem on my computer's installation. I looked in "/etc/shadow", but I am not looking at the correct one...that one has no password, so that must be the DVD one. How do I find the "/etc/shadow" on the installed system? I am aware I won't be able to read the password in "shadow" because it is encrypted, but I should be able to just delete it, correct? Related: How do I run "nano" from the DVD, but open a file on my own system? |
there is a grub cheatcode that allows you to log into root without the root password, I forget what it is but some googling should turn it up
|
I do not have Grub, I have LILO.
Hmm, I wonder if you can do that in LILO. Anyway, probably easier just to edit the "/etc/shadow" on my new system. Problem is I can't tell where it is, and I'm only looking at the one on the DVD. |
Found a link, we'll see what happens.
Thanks, Ace, I didn't know you could do anything like that. Actually, that's scary...anyone could wipe out your password when you're not looking...granted, you can do the same back!
For anyone else with this same question, the link is: http://linuxgazette.net/107/tomar.html And, for LILO, it says: Follow these steps to reset the password when using LILO: * Reboot the system. When you see the LILO: prompt (see Fig. 1 below), type in linux single and press 'Enter'. This will log you in as root in single-user mode. If your system requires you to enter your root password to log in, then try linux init=/bin/bash instead. * Once the system finishes booting, you will be logged in as root in single-user mode. Use passwd and choose a new password for root. * Type reboot to reboot the system and then you can login with the new password you just selected. If you have a new version of LILO which gives you a menu selection of the various kernels available press Tab to get the LILO: prompt and then proceed as shown above. |
No go on above cheat code.
Whether I use "linux single" or "linux init=/bin/bash", LILO tells me "no image by that name".
Tried booting from DVD and entering "linux rescue" there, same error. Tried USB stick, but I'm not sure that the boot-disk creation on the USB even suceeded in the first place. Same error. I will try Knoppix approach when I wake up (I am too tired now), but one thing I am confused about in the instructions is this: Quote:
|
Not sure if this thread will have an answer, but worth looking at:
http://www.linuxquestions.org/questi...d.php?t=535701 |
That is what I want to do, but I don't know how.
Using the link above, I see the person was directed to do the same thing I am trying to do:
Quote:
I am finding only my DVD's "/etc/shadow". So where is the computer's filesystem mounted when I boot into the DVD? |
Quote:
Otherwise, I'd open up a terminal shell, and manually mount your hard drive if it's not already mounted. You can then traverse the mount point to find /<mount_point>/etc/shadow to edit. |
When you boot from live CD, simply open a terminal and enter "fdisk -l". That will tell you where all your partitions are. You have to then figure out which one has the "/etc" directory. Once that is mounted, then go into /etc and find the "passwd" file. Edit this file to remove the "x" after the first ":". (Use whatever editor is installed--I use nano because its almost always there.) The edited file will look something like this:
root::0:0:root:/root:/bin/bash save the file and reboot--you will now be able to login as root with no password. One thing to be careful about: Suppose you have mounted the appropriate partition and "ls" shows that etc is there. To enter the etc directory, be sure not to do "cd /etc"--that would take you back to the /etc directory associated with your live linux). From the root level of the mounted partition, you would do "cd etc" |
in KNOPPIX just go to /media and that is were your harddrive is
|
The LinuxGazette solution worked [SOLVED]
http://linuxgazette.net/107/tomar.html
Thanks all. I couldn't do the solutions they suggested from the bootloader...every command I entered was interpreted as a boot image LILO thought I wanted it to look for. As for the confusion about finding the proper /etc/shadow, that was because I was booting from my Slackware DVD. Need to use a "live" CD! (I did say I was tired. :o ) As for the "hda" vs. "sda" thing, well, I guess that's just the way it is -- the partition table uses "sda" to denote that the hard disk is SCSI, but apparently the live CD could care less. Using "hda2" worked just fine. The instructions on LinuxGazette to mount and cd into the proper directory were perfect. My only complaint is the Knoppix Live CD doesn't have nano. :eek: VIM is very strange. I deleted the hashed password, rebooted, logged in as root, and reset my password. |
All times are GMT -5. The time now is 08:52 AM. |