You are not logged in.

#1 2010-06-14 21:58:49

cteampride
Member
Registered: 2010-01-10
Posts: 15

recover locked root account

I first will admit: I am stupid stupid stupid for doing this...

My question is it possible to recover my root account if:
1) it has been locked with:

passwd -l root

which normally just locks the root account and should be undo-able by

sudo passwd -u root

2) my root login has been disabled with:

Defaults timestamp_timeout=0,rootpw

in my /ect/sudoers

so now i fully understand how to make a system completely void of an accessable root account big_smile

EVEN when i tried booting into single user mode, it prompts for my root passwd on boot but since i diabled root login, it seems this doesnt work either. 

So im reinstalling soon, unless there is a quick fix i cant think of.  help tongue

P.S. dont try the above commands (together) at home, its baaad news kids

Offline

#2 2010-06-14 22:01:38

Trent
Member
From: Baltimore, MD (US)
Registered: 2009-04-16
Posts: 990

Re: recover locked root account

Boot to a liveCD and chroot into your install.

Offline

#3 2010-06-14 22:09:29

Bolts
Member
From: Moorhead, MN
Registered: 2009-05-09
Posts: 39
Website

Re: recover locked root account

Edit /etc/passwd from a live CD and set the second field to 'x', then edit /etc/shadow and set the second the second field to blank.  That will set you root password to empty:  After that, reboot and login to a console as root and change the password as normal with passwd.

EDIT: Actually, all you need to do is remove the '!' from the front of the hash (second field) in /etc/shadow and the old password should work again.

Last edited by Bolts (2010-06-14 22:13:56)

Offline

Board footer

Powered by FluxBB