Since there are 6 running levels in linux, the single-user running level is-1, the running level is single-user mode. In this mode, you can change the root password. this mode has the following features: pass parameter 1 for the kernel or single can enter single-user mode.
Because there are 6 running levels in linux
The single-user running level is-1, which is the single-user running level.
You can change the root password in this mode.
This mode has the following features:
Passing parameter 1 or single for the kernel can enter single user mode'
Do not start any service in single-user mode
In single-user mode, the root user is logged on by default, and no password is required.
You can use passwd to change the root password.
The process is as follows:
First, restart the instance. you can press "e" to edit it when selecting a Linux boot guide.
Select the kernel line and enter edit. add 1 or single at the end and press B to enter single-user mode.
This completes the entry to the single-user mode.
In this way, you can change the password.
In this way, there is a restriction that anyone who has access to the computer can modify the root password after restarting.
Therefore, grub can be encrypted.
Add the following parameters to grub. conf to encrypt grub.
Passwd -- md5 & asdf234123qwer, which is not divided into encrypted passwords.
The encrypted password can be generated through the grub-md5-crypt
For security purposes, if you forget the root password and grub password, you will not be able to fix it. reinstall it, cool!