Solution for forgetting the root password in ubuntu
Source: Internet
Author: User
If anyone says that his Linux has never encountered "difficult issues", I think it is untrusted. Even the most friendly WindowXP operating interface often encounters various problems, some problems can be solved only by replacing the hardware! Linux is also like this, and its freedom is also increasing the frequency of problems. Of course, it is also because of the open source features of Linux. No matter what the problem occurs, you can find the crux of the problem at the source code level. This is the charm of Linux. 1. Without Logon, I think it is untrusted to obtain the root permission, even the most friendly Window XP on the operating interface often encounters various problems. Some problems can be solved only by replacing the hardware! Linux is also like this, and its freedom is also increasing the frequency of problems. Of course, it is also because of the open source features of Linux. No matter what the problem occurs, you can find the crux of the problem at the source code level. This is the charm of Linux.
1. Get the root permission without logging on
If the GRUB Password is not set, we can use the simplest method. First, start the computer and wait for the GRUB menu. If the GRUB menu is hidden, Press Esc to bring it up and select Ubuntu, kernel 2.6.12-* (recovery mode), that is, "recovery mode", Press Enter to start. Another method is to use the Ubuntu installation disk to obtain the root permission and start the computer with the Ubuntu installation disk. When "boot:" is displayed, enter "rescue"
Boot: rescue
Follow the on-screen prompts.
2. Get the root permission by changing the kernel startup parameters
Start the computer and wait for the GRUB menu. If the GRUB menu is hidden, Press Esc to call it up. If the GRUB Password is set, press p to unlock it. For example, if we select Ubuntu, kernel 2.6.12-8-386, press e to edit startup parameters before startup, select kernel/boot/vmlinuz-2.6.12-8-386 root =/dev/hda2 ro quiet splash, press e to edit the selected Start Menu item, and add rw init =/bin/bash at the end of the parameter, that is, change it to the following command line:
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service