Ubuntu14.04 how to forget the root password

Source: Internet
Author: User
The computer has been useless for more than 20 days. I forgot the Ubuntu14.04root password. Here is a solution found on the Internet. Others are similar to this one. Some of them are missing and cannot solve the problem for me. The final problem is solved through analysis. Record the key points of the current solution. I hope it will be convenient for others. 1. Start the instance, as shown in figure (no virtual machine is installed, and the pictures taken by the mobile phone can be taken together): 2. There will be an option: AdvancedOptionsforUbuntu.

The computer has been useless for more than 20 days. I forgot the Ubuntu 14.04 root password. Here is a solution on the Internet. The others are probably the same as this one. Some of them are missing and cannot solve the problem for me. The final problem is solved through analysis. Record the key points of the current solution. I hope it will be convenient for others.

1. Start the instance, as shown in figure (no virtual machine is installed, and the pictures taken by the mobile phone can be used together ):

2. There will be an option: Advanced Options for Ubuntu, select and press enter directly, for example:

3. There are many options in it. select the option with recovery mode (do not press ENTER !), Press the letter e, for example:

You can select one with a recovery mode, but you 'd better select the one with a higher version. In fact, you can press enter directly, which will be explained later.

4. The key time is up. The last and fourth lines will show a line of linux/boot/vm... ro recovery \ nomodeset,

Step 1: Delete recovery \ nomodeset

Step 2: Add quiet splash rw init =/bin/bash at the end of this line

These settings are not necessary. If you need to change here, you can change the ro To rw. If usr is mounted to another partition, an error may be reported after modification. Because only the root partition is mounted in recovery mode.

5. Press F10 to start.

6. If there is no accident, you will enter the system, enter passwd, and the system will prompt you to enter a new password to end.

This method may be helpful, but it is difficult on my machine. According to my red note, step 1 should look like another one.

6. Select root drop to root shell prompt in the recovery menu, and press ENTER

7. Go to the shell interface and run the passwd command to set the new password: passwd. <用户名>

The passwd command may not be found. This is because the passwd command is in/usr/bin. If the usr is mounted to another partition, the passwd command cannot be found because the directory load recovery mode is not mounted. The solution is to re-mount the usr partition. You can mount all the partitions, or use the cat command to view/etc/fstab [and/etc/mstab (this should not be checked)] to find the partition with the mount point usr, then run the mount command to mount it. Then you can run the passwd command.

8. Enter the new password, and then enter the new password again. If you see the password updated successfully, the password is successfully entered.

If you do not change ro to rw in step 1, the authentication token manipulation error will appear. This is because the disk is mounted in read-only mode and the command "mount-o rw, remount/"re-mount the root partition to read/write mode.

For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2

This article permanently updates the link address: Http://www.linuxidc.com/Linux/2015-05/117852.htm

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.