root Password." /> root Password." /> root Password." />
LinuxDevCenter.com
oreilly.comSafari Books Online.Conferences.
BooksAll ArticlesSafari BookshelfO'Reilly GearFree Newsletters

FAQS
 FAQs
Apache FAQ
Linux FAQ
XML FAQ

Log in to particpate





TECH JOBS


   Linux FAQ > 7. Solutions to Common Miscellaneous Problems
Question:  7.16. I Forgot the root Password.
Answer:

Note: 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]


This FAQ is from Linux Frequently Asked Questions with Answers, maintained by Robert Kiesling

Sponsored by:

Contact UsMedia KitPrivacy PolicyPress NewsJobs @ O'Reilly
Copyright © 2000-2006 O’Reilly Media, Inc. All Rights Reserved.
All trademarks and registered trademarks appearing on the O'Reilly Network are the property of their respective owners.
For problems or assistance with this site, email