Linux forgot root Password

Source: Internet
Author: User

Linux forgot root Password


We often encounter a situation where we forget the root password. Here is the solution,
This method uses the vast majority of Linux releases:

1. First go to grub

2. At the entrance to be edited, press e and add
Init =/bin/bash, press CTRL + x to start. Note: The quite here is generally
The most common online saying is that the second line specifies
That line. In fact, the current system may not be able to adapt.
For example, in my debian system, this line is displayed:
Linux/boot/vmlinuz-3.14.18 root... ro quiet
Therefore, we only need to add init =/bin/bash after the row quite
OK.

3. After the startup, run the following three commands:
# Mount-o remount, rw/
# Mount-
# Passwd root

If the system does not set the root password, go to the recovery mode.

And then execute the three commands mentioned above.

By the way, the method for adding a user to a sudo group is: usermod-G sudo username.

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.