[plug] Tips for people like Kimberley (and those who cannot boot their machine... :-)

Onno Benschop onno at itmaze.com.au
Tue Mar 16 18:44:17 WST 2004


In my search for using CVS and backing up a difference, I stumbled
across this page which has a whole host of cool tips:

	<http://www.pdxlinux.org/doc/Debian/reference/ch-tips.en.html>

I'll quote one, that comes to mind :-)

---Quote from above link---
8.1.1 "I forgot the root password!" (1)
It is possible to boot a system and log on to the root account without
knowing the root password as long as one has access to the console
keyboard. (This assumes there are no password requests from the BIOS or
from a boot-loader such as lilo that would prevent one from booting the
system.)

This is a procedure which requires no external boot disks and no change
in BIOS boot settings. Here, "Linux" is the label for booting the Linux
kernel in the default Debian install.

At the lilo boot screen, as soon as boot: appears (you must press a
shift key at this point on some systems to prevent automatic booting),
enter:

     boot: Linux init=/bin/sh

This causes the system to boot the kernel and run /bin/sh instead of its
standard init. Now you have gained root privileges and a root shell.
Since / is currently mounted read-only and many disk partitions have not
been mounted yet, you must do the following to have a reasonably
functioning system.

     init-2.03# mount -n -o remount,rw /
     init-2.03# mount -avt nonfs,noproc,nosmbfs
     init-2.03# cd /etc
     init-2.03# vi passwd
     init-2.03# vi shadow

(If the second data field in /etc/passwd is "x" for every username, your
system uses shadow passwords, and you must edit /etc/shadow.) To disable
the root password, edit the second data field in the password file so
that it is empty. Now the system can be rebooted and you can log on as
root without a password. When booting into runlevel 1, Debian (at least
after Potato) requires a password, which some older distributions did
not.

It is a good idea to have a minimum editor in /bin in case /usr is not
accessible (see Rescue editors, Section 11.2).

Also consider installing the sash package. When the system becomes
unbootable, execute:

     boot: Linux init=/bin/sash

sash serves as an interactive substitute for sh even when /bin/sh is
unusable. It's statically linked, and includes many standard utilities
as built-ins (type "help" at the prompt for a reference list).

---End Quote---

...I'm back to CVS...

Onno Benschop 

Connected via Optus B3 at S41°18'23" - E146°49'07" (Holwell, Tas)
-- 
()/)/)()        ..ASCII for Onno.. 
|>>?            ..EBCDIC for Onno.. 
--- -. -. ---   ..Morse for Onno.. 

Proudly supported by Skipper Trucks, Highway1, Concept AV, Sony Central, Dalcon
ITmaze - ABN: 56 178 057 063 - ph: 04 1219 8888 - onno at itmaze dot com dot au




More information about the plug mailing list