[NTLUG:Discuss] ARGH! Root password lost

Steve Baker sjbaker1 at airmail.net
Tue Jan 18 11:47:23 CST 2000


Kathleen Weaver wrote:
> 
> Short of reinstalling Linux, is there a way to change the root password?

If you know the old password, just log in as root and
use the 'passwd' command.

If you've forgotten it...

You'll need to shut the machine down so you can
reboot it. Hopefully your machine is set up to
let you do that without root permission (try
Ctrl-Alt-Del as a regular user).  If not, get
everyone off the machine, wait a couple of minutes
and then just hit reset.

Reboot from the SuSE-provided boot floppy - or from
a CD or something - you should then be in single-user-mode
logged in as 'root' - then mount the hard drive under
/mnt, and edit /mnt/etc/passwd to remove the password
field on the root account.

  root:sdfLKJHda:0:0:Super-User:/:/bin/tcsh
       ^^^^^^^^^
       Remove whatever gibberish is
       in here between those first two
       colons.

Then reboot from the hard drive, log in as root (no password!)
and set the password in the usual way using 'passwd'.

You might want to disconnect from the network while you
do this since there will be a brief spell when your root
account will be 'exposed'...you'd have to be pretty
paranoid to do that though!

--
Steve Baker                (817)619-2657 (Vox/Vox-Mail)
Raytheon Systems Inc.      (817)619-2466 (Fax)
Work: sjbaker at hti.com      http://www.hti.com
Home: sjbaker1 at airmail.net http://web2.airmail.net/sjbaker1




More information about the Discuss mailing list