From: Felix Müri <felix@mu...> - 2001-04-11 08:54:57
> don't know the root password for. Boot it up single-user ('single' on the
> command line) and change the root password when you get a root shell.
For the debian distribution the booting in single-user mode starts
the program sulogin, which asks the password of the root user before
starting a shell. So if you don't know the root password...
The easiest way to crack a linux system is booting an auxiliary
system (floppy, cdrom) and mount the target root partition into the
auxiliary system. Then simply edit /mnt/etc/passwd (or whatever mount
point you have chosen).
Under u-m-l this is simply a matter of using the loop-device
(mount -t ext2 -o loop=/dev/loop0 /patch/to/root_image /mnt).
Another useful hack is exchanging the init process with /bin/sh
(command line option: linux init=/bin/sh udb=... ...). But then you
need to take care, that you initialise the system properly (remounting
the root partition rw, evtl. fsck, update-daemon etc.)