Ubuntu forgot the password. How can I solve this problem if I forget the root password!

Source: Internet
Author: User
Forgot the password for Ubuntu and the root password? Although it is a small probability event, some people have encountered it. What should we do? Oh, don't worry. Thanks to the headmaster for his methods. I would like to give it a thumbs up! Ubuntu root is disabled by default. During installation, you are not required to set the root password, which is different from the Red Hat system series. To use root in Ubuntu, we can use the terminal to set the password sudopasswdroot for the root user,

Forgot the password for Ubuntu and the root password? Although it is a small probability event, some people have encountered it. What should we do? Oh, don't worry. Thanks to the headmaster for his methods. I would like to give it a thumbs up!

Ubuntu root is disabled by default. During installation, you are not required to set the root password, which is different from the Red Hat system series. To use root in Ubuntu, we can use a terminal to set a password for root.

sudo passwd root

If the password of a common user is forgotten, use root to modify the password. If the root user forgets it, it enters the single-user mode, which is different from the Red Hat system series.
The specific method is as follows:

Enter single user mode:
#1. When the machine is started into grub, use the up/down key to move to the recovery mode of the second line, and press e (note that it is not the carriage return)
#2,
SetRo singleChangeRw single init =/bin/bashAnd press ctrl + x to enterSingle User ModeYou can do whatever you want. (It's a command line, so you have to understand how to use it !) You can change the password of a common user or the root user. Prompt: Press ctrl + alt + delete to restart the system. (I tried to shut down the system by using the command. I can only use this command to restart the system ).

I have tried these things and they are also successful. Please try them! I have read some methods on the Internet and tried some of them! Some methods use the Red Hat system series, and some are incorrect!

To change the password of a common user, run the following command:

 PasswdUser Name
Related Article

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.