How to fix a forgotten root password

First, don't panic! This is usually a simple matter so long as you have physical access to the console. Simply follow the steps below to boot the system bypassing login, and then set a new password:

  1. Reboot the system. Make sure your physically present.
  2. When the Grub menu comes up, press “e” to edit the menu selections.
  3. Select the kernel you would usually boot and press “e” to edit the settings.
  4. Add single init=/bin/bash” to the end of the existing line. This will set the system to boot in to single user mode and immediately load a bash shell.
  5. Finally, press “b” to boot.

The system will boot up into single-user mode with the root file system mounted read-only. To set a new password you will first need to re-mount it read/write:

mount -o remount,rw /

Now you can proceed to set a new root password:

passwd

Reboot and relax.

Discussion

Enter your comment (wiki syntax is allowed):

Subscribe to the RSS feed for Andy's Debian HOWTOs

Article from Andy's Debian HOWTOs (http://www.besy.co.uk/debian/debian)

 
debian/how_to_fix_a_forgotten_root_password.txt · Last modified: 2008/08/01 23:56 (external edit) · [Old revisions]
Recent changes RSS feed Powered by Debian Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki