Linux forgot root password

Source: Internet
Author: User


We often encounter the forgotten root password situation, the following is the solution,
This method uses the vast majority of Linux distributions:

1. First Enter GRUB

2. At the entrance to edit, press E to add after quite
Init=/bin/bash, press Ctrl+x to start. Note: The quite here are generally
The most popular word on the web-the second line, which specifies kernel's
That line. In fact, on the present system, it may be a long time ago.
For example, on my Debian system, this is the line:
linux/boot/vmlinuz-3.14.18 root ... ro quiet
Therefore, we only need to add init=/bin/bash after the line quite
It's OK.

3. After booting, execute the following three commands:
# Mount-o REMOUNT,RW/
# mount-a
# passwd Root

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

You can then execute the three commands mentioned above.


By the way, add the user to the sudo group by: usermod-g sudo username.

Linux forgot 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.