Forgot Root Password
You can't log in as root and you think that you have lost your password?
Does your system allow direct root login? You may have the correct password, and it just may not permit root logins
- Try using the same password with su if you haven’t already.
- Or if your normal user has sudo access you can use that one. That might be the problem.
You have lost your root password - root login is allowed
- Boot with your favorite rescue-CD (e.g. Knoppix), become root
- mount the root-partition of your system read/write (let’s say to /mnt).
- Then do ‘chroot /mnt’. You will now be running your regularly installed linux.
- Do ‘passwd root’ and type in the new password.
- Press ctrl-D to leave the chroot-environment
- unmount your root-partition and reboot.
How do you do it without a rescue disk? Enter single user mode.
With GRUB: (Assuming you haven't set a grub password):
- At the grub boot menu highlight the system you wish to boot and tap ‘e’.
- Highlight the kernel line and tap ‘e’ again to edit.
- Append the following to the kernel line which will cause it to boot to single user mode.
- Tap ‘b’ to boot. After the boot you will have the
# prompt.
- Type the following to remount the root partition read-write.
- Type the following to change the root password.
passwd
- Enter your new password and tap ENTER. Repeat to confirm
- Type the following after setting the new password:
- Use Ctrl Alt Del to reboot.
With LILO:
- When you see the boot: prompt, type ‘linux single’ to enter single-user mode.
- If you have used some other title than the default ‘linux’ for your system, then use that with the word ‘single’.
- At the bash# prompt type
passwd root
- You’ll be asked to re-type the password for verification.
- After you’ve changed the password reboot by typing ‘shutdown -r now’.
- Then log in to root with the new password.
Copyright (c) by the authors.
Prior to editing, authors agreed to license their contributions by the terms of the GPL.
See our licensing page for details.
Linux® is a registered trademark of Linus Torvalds.
tutorials/advanced/various/forgot_root_password.txt · Last modified: 2008/07/20 19:08
Welcome to LinuxBasics.org - The online community that helps people to get Linux installed and running.
During this tour, we will guide you through our website, which has many facets which wait to be explored
The biggest project we are running is our Linux course, based on the LBook.
The book is stored in wiki-format, which enables us to update and correct it as we go.
Discussion for the course is on our Forum
Our Forum is used for discussion of Linux and for questions and answers.
Search the mailing-list that was used prior to the Forum.
The questions and answers from the list are stored in the list's archives in order to help others with the same problems.
Every weekend, we meet to chat in IRC. These meetings are NOT mandatory, but are a nice chance to get to know each other better.
IRC is also a great tool to solve many problems, since it is very quick and easy to ask for more details if you need them.
The tutorials are one of the oldest sections on the LBo-website.
Here you find explanations on how to do specific tasks in Linux. Many of the tutorials were created after a certain problem
has been discussed (and usually solved :) on the mailing-list.
The tutorials are categorized in
In the links section, you find outbound links to other valuable resources.
One of our later additions to the site. We maintain a mirror of the Linux Documentation Project. This is our contribution to the "home of the HOWTOs"
Another later addition is the LBlog which focuses on how to do stuff on the Linux Desktop. It begins with the basics on installing Ubuntu.
Using the integrated site-search, you can search the tutorials, the LBook and all other wiki-pages
Simply type the search term into the box in the upper-right corner of our webpages
As a community, we depend on your feedback and collaboration. So, if you have something to share with others, please contact us. If you have a suggestion for a topic you would like to see covered here, please add it on the Wishlist.
There are many ways to contribute: You can answer questions on the Forum, you can write a complete tutorial or just a step-by-step documentation on how you completed a specific task using linux. Ask questions if the information on this site is not clear, tell us if we got something wrong, spell-check our writings, whatever.
We are looking forward to meeting you at LinuxBasics.org
Anita, Jisao, Sam and Stefan