LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
 
Search this Thread
Old 03-08-2006, 04:45 PM   #1
fab65
LQ Newbie
 
Registered: Jun 2005
Posts: 2

Rep: Reputation: 0
sarge: root password recovery procedure doesn't work!


Hello.
I'm trying to recover the root password with sarge but I've a problem.

In woody release, the procedure was:

from CD :
linux init=/bin/sh
At the root prompt:

#mount -n -o remount,rw / (mount the / as read write).
#vi /etc/shadow.... etc...

With sarge, the command mount -n -o remount,rw / says "can't find /etc/fstab".

Pleaase, could you help me?
Thank you.

fab65
 
Old 03-08-2006, 05:10 PM   #2
jonaskoelker
Senior Member
 
Registered: Jul 2004
Location: Denmark
Distribution: Ubuntu, Debian
Posts: 1,524

Rep: Reputation: 46
Hmm... that's odd. Since you're remounting / and not /etc, it must mean that /etc is just a folder under /, or you've misunderstood soomething. You only have one post, so I can't check on your "background", so I choose to not give you the benefit of the doubt (that is, I assume you're a newbie--no offense meant) (on the other hand, you use vi... hmm... you might have been spoon-fed enough instructions, so that doesn't disprove my guess).

That implies that my guess that /etc is just a folder may be wrong. One possibility (which I think is somewhat likely) is that you haven't mounted your /etc partition. So mount /etc `manually', read-write of course, and go ahead and do your deed. You may want to mount some other partitions as well (say, if you have a seperate /usr, you'll probably want to mount it).

Hope this helps --Jonas
 
Old 03-08-2006, 05:20 PM   #3
jonaskoelker
Senior Member
 
Registered: Jul 2004
Location: Denmark
Distribution: Ubuntu, Debian
Posts: 1,524

Rep: Reputation: 46
Hmm... that's odd. Since you're remounting / and not /etc, it must mean that /etc is just a folder under /, or you've misunderstood soomething. You only have one post, so I can't check on your "background", so I choose to not give you the benefit of the doubt (that is, I assume you're a newbie--no offense meant) (on the other hand, you use vi... hmm... you might have been spoon-fed enough instructions, so that doesn't disprove my guess).

That implies that my guess that /etc is just a folder may be wrong. One possibility (which I think is somewhat likely) is that you haven't mounted your /etc partition. So mount /etc `manually', read-write of course, and go ahead and do your deed. You may want to mount some other partitions as well (say, if you have a seperate /usr, you'll probably want to mount it).

Hope this helps --Jonas
 
Old 03-08-2006, 06:18 PM   #4
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 656Reputation: 656Reputation: 656Reputation: 656Reputation: 656Reputation: 656
You may not have the root partition mounted, and are running in the ramdisk.
Type the "mount" command by itself to see what is mounted.
Also check the output of the "fdisk -l" command which lists which drives/partitions it finds. Then determine whether the root parition is mounted. If not, you could mount it under /mnt and then use the chroot command to make it your new root partition for that shell. Then "mount -a" will attempt to mount everything in your /etc/fstab file that has the "auto" option. Next for good measure, I would run "/bin/bash -l". This will start a new login shell, which will setup your normal aliases and paths.
 
Old 03-08-2006, 09:41 PM   #5
spooon
Senior Member
 
Registered: Aug 2005
Posts: 1,755

Rep: Reputation: 48
This is a side comment, but you can also boot into single-user mode and change the root password or do other stuff as root from there (see here for more information).
 
Old 03-09-2006, 02:15 AM   #6
abd_bela
Member
 
Registered: Dec 2002
Location: algeria
Distribution: redhat 7.3, debian lenny
Posts: 601

Rep: Reputation: 31
Hi,
the procedure is easy if you have your Cd 1 ( installer disk).
boot with it as you want to install, when the hard disk is detected, change screen ctrl+alt+F2, for example, and now you have the root but for the installer kernel ( from CD),
detect the number of your / partition with fdisk if you don't know it!!
the name of the disc is not /dev/hda, hdb,( not yet at this step of installation) but it is /dev/ide/......., ( for ide disk ) use TAB to complete the name

mkdir mt ........> create a mount point

mount /dev/ide/......( partition) mt
chroot mt -------> to switch to your disk
mount -t proc /proc /proc --------> in general not required
passwd ----------------------> to change the password, that is OK

I have done this procedure many and many time it is working fine, you can use it also to reinstall the grub, if for example, you have detroyed it by install wind$,
grub-install /dev/hda ( if you have an ide disk)

Hope this help you

best regards
bela
 
Old 03-15-2006, 05:11 PM   #7
fab65
LQ Newbie
 
Registered: Jun 2005
Posts: 2

Original Poster
Rep: Reputation: 0
Hi Bela.
Thank you. Your suggestion works well!!

Fab65
 
  


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
Root password recovery Jabber Linux - Security 6 11-27-2005 04:23 PM
Root Password Recovery ? Pravat Linux - Security 1 04-24-2005 04:46 AM
Password Recovery (not root) NewbGhostShells Linux - Newbie 3 12-17-2003 03:03 PM
root password recovery... roofy Linux - Software 7 05-06-2003 02:37 PM


All times are GMT -5. The time now is 04:57 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration