
How to: Recovering your Debian/FreeBSD root password
November 1, 2008Hi there again.
Probably, you’ve lost your root password at least one time in your life (yea, you are not the only one
)… There’s no problem, I’m gonna show you a easy way to fix it.
- For Debian (Using GRUB, anyway, this will work in any boot loader)
- In the line where is our Debian installation, press “e”
- Now a kind of editor will be opened. Type the following command after the current commands: “init=/bin/bash”
- Press enter
- Now you would be back in the first step. Just press de “b” key, to boot the system with the new parameters
- Now the system prompt would be a root session. But if you try to use “passwd” command, the system will deny the operation. To fix this, type “mount -o remount,rw /dev/[your_drive]“. Usally your drive will be sda1, hda1 or similar.
- Now use the passwd root command to change.
- Reboot and your computer and use your new root password
- For FreeBSD
- In the boot menu, choose the option 4 “FreeBSD in single mode user”
- Now a message like “Enter fill pathname of shell or RETURN for /bin/sh” will be shown. Just press ENTER
- The next step is typing “mount -t ufs -a“. This will mount every file system found in /etc/fstab
- Now just use the passwd root command
- Reboot the system