ultrastupid password question

Kevin O'Gorman kevin
Mon May 17 11:59:13 PDT 2004


On some systems I've found it better or necessary to madify it
a bit:

   mount -n -o rw,remount /

The -n avoids trying to write '/etc/mtab' on a filesystem that's
still read-only.

This approach has worked for me in the past.  However,
be aware that "linux init=/bin/bash" replaces the 'init'
process, and you do NOT get normal operation -- you get
a root shell, and not much else.

Accordingly, I have always worried that buffer management
and such are not normal either, because none of those
tricky little things in "inittab" get started either.

So, during shutdown, I carefully undo my steps:

   .... [ do "passwd" and any other needful things ]

   # Set it RO again, flushing everything and marking a good shutdown
   sync;sync;sync; mount -n ro,remount /   # set it RO again

   # It is possible the above may be unnecesary if you do this step,
   #  but I know this sequence has worked.  I'm disinclined to
   #  experiment.  There's an -f switch ("force") that may help too.
   #  Here the '-n' says don't write /etc/mtab.
   /sbin/reboot -n

When I do the above, I get a clean reboot, so that's what I do.

++ kevin



On Sun, 8 Feb 2004, Ken Moffat wrote:

> dep wrote:
> 
> >i don't believe i did this, but i did.
> >
> >in installing a linux machine for my sister and her family over 
> >christmas, i created a root password and guess what: there is no record 
> >of it. now i absolutely have to get root access to the thing or, more 
> >accurately, have to tell someone over the phone how to get root access. 
> >this is a suse-8.2 box.
> >
> >so. anybody know a quick, easy, sure-fire way of getting root access to 
> >the thing?
> >
> >i can't believe i did this.
> >  
> >
> If suse uses lilo this might work:
> 
> >/ >> Assuming your LILO image name is "linux", entering:
> />/ >>
> />/ >> linux init=/bin/bash
> />/ >>
> />/ >> at the LILO prompt should bring you to a root shell. //
> />/ >
> />/ > The above has the drawback of mounting the root filesystem in readonly
> />/ > mode.
> />/ 
> />/ # mount -o remount,rw /
> />/ 
> />/ > LILO: linux single/
> 
> then just change the root password using "passwd"
> I'll try my grub boot to see if it works here.
> 
> 

-- 
Dr. Kevin O'Gorman  (805) 756-2986  mailto:kogorman at calpoly.edu
Home Page: http://www.csc.calpoly.edu/~kogorman



More information about the Linux-users mailing list