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.