[ubuntu-uk] The need for root in a rescue situation

Paul Sladen ubuntu at paul.sladen.org
Sat Mar 24 15:11:59 GMT 2007

On Sat, 24 Mar 2007, Colin Murphy wrote:
> I recently had a corrupt HD on my Dapper desktop system and had a prompt
> thrown at me for the 'root password' by the minimal rescue system 

The prompt only occurs if a root password *has been set*.  Out of the box,
Ubuntu is configured to use 'sudo' and if you select '(recovery mode)' you
will get a superuser-prompt, no password prompt questions asked.

In the case that [after an out-of-the-box installation] a 'root' password
has been manually specifically set at any point, then either:

  (a) the password needs to be found
  (b) the password can be reset/removed by:

Booting with:

  linux init=/bin/sh          # Load a shell as the first program, not init

and then manually running commands to:

  mount / -oremount,rw        # Make the root partition writable
  passwd -l                   # Clear the user-set root password
  sync                        # Force write the change to disk
  mount / -oremount,ro        # Unmount/mount read-only again

Why do one side of a triangle when you can do all three.   Nottingham, GB

More information about the ubuntu-uk mailing list