LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-08-2007, 06:54 PM   #1
JSR_tuxbox
LQ Newbie
 
Registered: Jun 2007
Distribution: debian etch
Posts: 26

Rep: Reputation: 15
Recovering root password in debian with grub bootloader


Hi, all!

I'm trying to recover the root password for a linux installation that I did about three months ago. Lost the slip of paper... anyway, I've found a couple of solutions online involving editing the line containing "kernel" in the grub loader. The first one suggested adding "single" to the end of that line; but when I did that, the system prompted me for the root password so that I could perform maintenance. Doh!

The second solution I found was to add "init=/bin/sh" to the end of the same "kernel" line. I did this, and it seemed to drop me into a shell. The next step was to "mount -orw,remount /". I did this, then typed "passwd", at which point I was informed that the shell did not recognize the command "passwd". This is when I realized I was out of my league. I typed "exec init," signed online, and made this post. If anyone could help me with this, I'd really appreciate it.

Incidentally, am I at risk because I forgot to "mount -oro,remount /" before "exec init"? Is all my system open for writing now?

Thanks in advance for any help!
 
Old 12-08-2007, 06:58 PM   #2
Agrouf
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: LFS
Posts: 1,596

Rep: Reputation: 80
maybe try /usr/bin/passwd or wherever the command is located...
 
Old 12-08-2007, 08:02 PM   #3
JSR_tuxbox
LQ Newbie
 
Registered: Jun 2007
Distribution: debian etch
Posts: 26

Original Poster
Rep: Reputation: 15
Thanks! I looked up the passwd command through google, and found that it is indeed supposed to be located in /usr/bin. Unfortunately, the shell tells me that that directory doesn't even exist! I swear, this is a functional installation -- I'm using it to submit these posts and everything. Does anyone have any more ideas? Is it possible that there's no /usr/bin because I'm "logged in" as root when I init the system in this way?
 
Old 12-08-2007, 11:17 PM   #4
Walker2
LQ Newbie
 
Registered: Dec 2005
Posts: 2

Rep: Reputation: 0
When your boot screen appears, press an up arrow key to suspend it. You'll notice a line near to bottom of the screen that contains the word "Boot options". You can now type a command on that line so type,
init=/bin/sh
press enter and when the text stops scrolling you should be presented with a blinking cursor. You then type
passwd
Press enter and you will then be prompted for a new root password. Type it in and press enter. You'll be asked to reenter it. Do so and press enter again. After you've done that -ctrl-alt-del restarts the computer.
Hope this works on your system. I've only used it on SUSE 10.3.
Good luck !
 
Old 12-08-2007, 11:23 PM   #5
HappyTux
Senior Member
 
Registered: Mar 2003
Location: Nova Scotia, Canada
Distribution: Debian AMD64
Posts: 4,170

Rep: Reputation: 244Reputation: 244Reputation: 244
See if you can edit the /etc/shadow file then on the line that starts with root: delete everything between the : after root to the next : then save the file that part is the password next time you boot the root password would be blank so you can set a new one alternatively boot with a live CD like Knoppix mount your / partition read/write then edit the shadow file that way.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Recovering root password in Redhat linux nthillaiarasu Linux - General 2 11-21-2007 07:11 AM
recovering root password gentoo lilo farhan Linux - Security 1 03-22-2006 08:57 PM
LXer: Howto: Recovering grub boot loader password LXer Syndicated Linux News 0 02-22-2006 04:16 AM
recovering root password isaacvimal Red Hat 3 04-02-2005 08:47 AM
recovering root password in rh using lilo farhan Linux - General 1 03-01-2003 08:45 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:42 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration