interview questions
How to retrieve the root password, if we accidentally forget the root password, how to retrieve it.
Idea: Enter the single-user mode, and then modify the root password. Because of entering single-user mode, root can log in without a password
.
Implementation steps
1. Turn on the machine -> enter the Enter key when booting -> see an interface and enter e
2. See a new interface, select the second line (edit kernel) and enter e
3. Enter 1 at the end of this line, and then enter the Enter key
4. Enter b again, then you will enter single-user mode
5. At this point, we enter the single-user mode and use the passwd command to modify the root password.