Restart the system.
Go to the system boot page:
Press the e key:
Select item 2, set the kernel startup parameters, and press the e key:
At the end, enter the number 1 or English "single" and press Enter:
Press the key B to start the instance.Single User Mode LevelBoot the program:
After the command is started, run passwd to change the password. After the modification, run exit to exit and restart. You can use the modified password for logon.
Problem: According to the above modification method, every user who has access to this system can change the root password. What should I do with root !!!
Solution: GRUB encryption.
How to Implement: In the grub. conf configuration file, configure the parameter password -- md5 xxxxxxxxxxxxxxxxxxxxxx
Procedure
Use the md5 Algorithm to generate a password:
Copy password.
Edit the/boot/grub. conf file
Configure the parameter password -- md5 password
Save and exit, and restart:
At this time, we found that the boot interface is slightly different from the boot interface that we entered for the first time. We need to enter the password. Press the p key:
Enter the password:
OK, so that we can go back to the first guide interface. Next we can follow the step of the first root password change.