Changing Root Passwords without a Live CD

Robert Brockway robert-5LEc/6Zm6xCUd8a0hrldnti2O/JbrIOy at public.gmane.org
Tue Feb 9 19:40:52 UTC 2010


On Tue, 9 Feb 2010, Lennart Sorensen wrote:

You took the words right out of my mouth Lennart :)

> On many systems single user still asks for a password.
>
> If you instead append: init=/bin/bash
>
> Then you get a root shell no matter what with no access to anything else.
> You can then remount / as rw if needed (mount -o remount,rw /) and run

-n may be necessary to account for a read-only mtab file:

mount -n -o remount,rw /

> passwd to set a new password.


The only other thing I'll add is that the system probably won't reboot 
cleanly if you have used init=/bin/bash so remount the filesystem 
read-only before rebooting or resetting.

mount -n -o remount,ro /

Cheers,

Rob

-- 
Email: robert-5LEc/6Zm6xCUd8a0hrldnti2O/JbrIOy at public.gmane.org
IRC: Solver
Web: http://www.practicalsysadmin.com
I tried to change the world but they had a no-return policy
--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list