Reset Root Password from Console
Written by: Will Kruss on 19 July 2012 01:26 PM
Know the method to reset your root password from the console. This guide tells how to reset a forgotten root password.
Don't know how to reset your root password from the console? Here is the excellent full guidelines to do it yourself.
Firstly, you need to access your machine via the console. For instructions on doing this please see: http://www.vpsblocks.com.au/support/index.php?/Knowledgebase/Article/View/28/0/how-can-i-get-console-access-to-my-vps
Once you have console access, follow these instructions to boot into single user mode.
At GRUB screen on startup (this flashes quite quickly) do the following:
1. Press a key to stop it booting automatically
2. Select the top kernel and press 'a' to modify it (on some linux variants you press 'e' to edit)
3. Use the arrow keys to highlight the line that begins with the word 'kernel' and press ‘e’ to edit the parameters
4. At the end of the line, add the word: single (then press Enter)
5. Press ‘b’ to boot the system
You will be dropped directly into a bash shell as root and can change the password. You can also access your file system from there.
To change your password simply type: passwd root