What to do if you forget root password?
Although this may seem like a small catastrophe to you, it's actually very easy to recover from that situation. What you need to do is to reboot (power on) your system, but on the LILO prompt you should type something like:
LILO: Linux init=/bin/sh rw
Where Linux is the example image name, you should supply the actual data, of course. And same parameters should be provided to GRUB or any other boot loader you might use.
init=/bin/sh part tells kernel to exec shell instead of init. That means that you'll end up with a very limited system, but which is fortunately capable enough for you to bravely type your new root password:
And don't forget to type
rw, too. Otherwise you'll end up with root partition mounted read-only. But, if you do, you can remount it read-write like this:
sh# mount -o remount,rw /
OK, after you have changed your password successfully, it's probably best to remount root partition as read-only and just press reset or power button of your computer:
sh# mount -o remount,ro /
The reason for such "drastic" action is that otherwise, e.g. if you typed
reboot at the prompt, your system would try to stop myriad of services that are not actually running when you have booted with the above parameters to the kernel. So the reboot would take longer (it could even get stuck at some point) and the output of all those failed
init.d scripts is definitely not for everybody's eyes. :)