|
If you have physical access to a Linux box there is all kinds of havoc you can wreak. Knowing the root password isn't necessary because there are a couple ways that you can change it. Keep tabs on your root password.
Sometimes stuff happens. Sometimes you set Debian up on your buddy's machine and you're both too drunk to remember what you did the next day. Root password!? OMFG! No, it's never happened to me, but I can believe it does happen. On your Debian box, and probably most other Linux distributions, a way to reset the root password is to reboot into single-user-mode. Some distros call it a recovery mode. It's not enough to simply select single-user-mode when you boot because you will still be prompted for the root password. What you have to do is edit your kernel line. Wicked easy. When Grub shows you your kernel boot options, hit the letter e to enable editing. Once you're actually in edit mode, arrow down to the kernel line and hit e again. What you need to do is add the following to the end of the line: init=/bin/bash So, your kernel option entry might red something like this:
/vmlinuz-2.6.18-5-486 root=/dev/hda2 ro vga=791 init=/bin/bash Hit enter after you've appended the entry, and then the letter b to boot that kernel. In a moment you will be entered into a limited bash shell so you can run the passwd command to reset your root password. You will not be able to run many other commands. For example: # shutdown -r now will not work. However, # halt will, so you can shut the box down after you've reset the root password with that. It'll shut down your hard drives but you'll probably have to power down the machine yourself. Restart your machine and then boot normally. Once up, fire up a terminal and check to see if you can't become root. There ya go. Yo have successfully reset the root password on your Debian GNU/Linux machine. It's creepy posting something like this but I have received many inquiries as to how it's done by some desperate sounding folks. --machiner 4 mar 08 all creeped out discuss
|