lotus



previous page: 092. If I Screwed Up the System and Can't Log In, How Can I Fix It?
  
page up: Linux FAQ
  
next page: 094. What's This Huge Security Hole in rm!?!?!

093. What if I Forget the root Password?




Description

This article is from the Frequently Asked Questions for Linux, the Free/Open Source UNIX-like operating system kernel that runs on many modern computer systems. Maintained by David C. Merrill with numerous contributions by others. (v1.0).

093. What if I Forget the root Password?

A:

Warning Incorrectly editing any of the files in the /etc/directory can severely screw up a system. Please keep a spare copy of any files in case you make a mistake.

If your Linux distribution permits, try booting into single-user mode by typing single at the BOOT lilo: prompt. With more recent distributions, you can boot into single-user mode when prompted by typing linux 1, linux single, or init=/bin/bash.

If the above doesn't work for you, boot from the installation or rescue floppy, and switch to another virtual console with Alt-F1 -- Alt-F8, and then mount the root file system on /mnt. Then proceed with the steps below to determine if your system has standard or shadow passwords, and how to remove the password.

Using your favorite text editor, edit the root entry of the /etc/passwd file to remove the password, which is located between the first and second colons. 'Do this only if the password field does not contain an x, in which case see below.'

 root:Yhgew13xs:0:0: ...                                                     

Change that to:

 root::0:0: ...                                                              

If the password field contains an x, then you must remove the password from the /etc/shadow file, which is in a similar format. Refer to the manual pages: man passwd, and man 5 shadow.

[Paul Colquhuon, Robert Kiesling, Tom Plunket]

 

Continue to:















TOP
previous page: 092. If I Screwed Up the System and Can't Log In, How Can I Fix It?
  
page up: Linux FAQ
  
next page: 094. What's This Huge Security Hole in rm!?!?!