[SWLUG] Resetting root password
Steve Hill
steve at nexusuk.org
Fri Jan 15 12:21:48 UTC 2010
On Fri, 15 Jan 2010, Neil Jones wrote:
> I am trying to edit the grub loader to append the word Single as several
> websites recommend.
I'm not sure if "Single" is recognised by many distros (I've never tried).
I always just stick a "1" on the end instead, which tells it to go to
runlevel 1 (which is single user mode)
> pressing e in grub takes me to an editor but I don't know how to save
> anything. I can go back to the grub menu but nothing
> is saved.
Press "e", scroll down to the line with the kernel parameters on it, hit
"e" again to edit the line, shove the " 1" on the end, press enter to
accept the changes, then hit "b" to boot with your changed parameters.
This is a one-time thing - nothing is saved, the next time you try to boot
everything will return to normal (so you need to do all this again if you
want to go back into single user mode).
Not sure about ubuntu, but some distros need the root password to get a
shell in single user mode, so this may not do you any good. If that's the
case, there is a workaround: Instead of putting a "1" on the commandline,
put "init=/bin/bash". This will start the system with *nothing* running
except the shell. The chances are that the root filesystem will be
mounted readonly too, so you'll need to do:
mount -o remount,rw /
Now fix your root password, then do:
mount -o remount,ro /
sync
You won't be able to shut down the system cleanly - just hit the reset
button at this point (you just remounted and synced your root filesystem,
so this should be quite safe to do).
--
- Steve
xmpp:steve at nexusuk.org sip:steve at nexusuk.org http://www.nexusuk.org/
Servatis a periculum, servatis a maleficum - Whisper, Evanescence
More information about the Swlug
mailing list