Ubuntu Root Password forgot Solution

Source: Internet
Author: User

 

Ubuntu has no password after it is installed. You can set the password as follows: sudo passwd root. after the password is set, there will be a problem. For example, if you usually use sudo operations, you will forget the root password after a long time. What should I do now? I have encountered this problem before, and I have not found a proper solution on the Internet. Then I suddenly came up with a solution to this problem.

 

In Linux, the user's password file is stored in the/etc/shadow file. Each user records a line and the password is encrypted, but sudo can still edit the text. So I want to replace the character string encrypted by the current user's password with the root password string. Then I can use the password of the current system to log on to the root user. After testing, this method is unavailable for desktop Versions later than 9.0.4.

 

So I went to the carefree forum to ask this friend to know that the root account is not enabled by default after the Ubuntu Desktop version is installed. I only need two commands to reset the root password:

Enter Sudo-I and press Enter.
Enter sudo passwd root and press Enter.
Enter the password twice to reset the root password...

 

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.