CentOS 7 solution for forgetting root password
CentOS 7 solution for forgetting root password
1. Restart and press esc
two。 Select the second menu and press e
3. Edit and modify two things: change ro to rw, and add init=/bin/sh after LANG=en_US.UFT-8
4. Press Ctrl+X to restart and change the password
5. Since selinux is open, you need to execute the following command to update the system information, otherwise the password will not take effect after reboot.
Touch /. Autorelabel
6. Restart the system
Exec / sbin/init