A simple method to reset the CentOSroot password

Source: Internet
Author: User
For a system administrator, the root password controls a considerable amount of security data. If you forget the root password, you need to retrieve it in time. Next I will introduce CentOS to you? Root Password is missing. I hope this will be helpful to the system administrator. There are two main methods, both of which are very simple.

For a system administrator, the root password controls a considerable amount of security data. If you forget the root password, you need to retrieve it in time. Next I will introduce CentOS to you? Root Password is missing. I hope this will be helpful to the system administrator.

There are two main methods, both of which are very simple.

Method 1:

1. when starting the system, you can see the boot directory, use the up and down arrow keys to select the system you forgot your password, and then press "e ".

2. next you can see the figure shown in. then you can use the up/down key to select the latest kernel, and then press "e ".

3. after completing the previous step, you can see the following picture. add "space" at the end of rhgb quiet, and then type "single", or enter "1" of the number and press enter to confirm.

4. press "B" to reboot the system.

5. after entering the system, you can use the familiar passwd root to change the root password. Reboot after modification.

Method 2

If you want to test a program today, you can start centos5.2 on your vm. as a result, the root password cannot be used.

I can find a solution from the internet. The following is an excerpt:

GRUB:

On the boot loader menu, type the [e] key to enter the editing mode.
You will see a list of pilot projects. Find a sentence line similar to the following output:
Kernel/vmlinuz-2.6.18-0.4 ro root =/dev/hda2

Press the arrow key until the line is highlighted and then press [e.
Now you can press a space at the end of the text and then enter: single and press enter to tell GRUB to guide the Linux mode of a single user.
You will be taken back to the editing mode screen. from here, press the [B] Key and GRUB will guide the single-user Linux mode.

After loading, you will see a shell prompt similar to the following:
Sh-2.05 #

Now, you can change the root command and type:
Bash # passwd root

You will be asked to retype the password for verification. The password will be changed. you can enter reboot at the prompt to re-import
Then, log on as the root user as usual.
 

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.