PS:
In daily deployment projects, the operation of forgetting the password is often caused due to many business types. This document records the real and effective operation of changing the login password. The system used this time is centos 7.9. Just the record does not mean that it is applicable to the entire system
For reference only
1. First, restart the system to enter the selection interface (as shown in the figure below)
. 2. Press E to edit the selected system.
3. After entering the edit interface, find linux16 and add a string of commands init=/bin/sh at the end of the line, as shown in the figure below
4, Press crtl+x to enter single-user mode
5. Enter the command; mount -o remount,rw /
6, and then type passwd as shown in Figure
7. At this time, you are prompted to enter a new login password of at least 8 digits
. After the reset is complete, type touch / .autorelabel Command
9, enter exec /sbin/init to exit editing and restart