Reset Root Password
From MyWiki
If you forget the root password for a linux machine:
Fedora
Boot into single user mode by appending the word "single" or "1" at the boot prompt. The system will come up and put you into a command prompt, at which point you can simply use the passwd command to reset the root password.
This does not work on Debian because it will ask you for the root password even when trying to enter single user mode.
Generic
This procedure should work regardless of the linux distribution.
- At the boot prompt, append init=/bin/bash and boot it
- Wait for the command prompt
- Get the device name for your root file system with the mount command. It will be /dev/something
mount
- Remount the filesystem into rw mode. A typical command might look like:
mount -o remount,rw /dev/something /
- Change the root password
passwd root
- Reboot with normal options
shutdown -r now
