No:1
start the system, press "E" key in the Grub interface, go to edit mode, find the line starting with "linux16", add "Rd.break" at the end of the row, and press "Ctrl X" to start: # Mount -o remount,rw/sysroot # #以读写方式挂载/sysroot#chroot /sysroot # #切换根目录 #Echo "liuqi.com"| passwd --stdin root#touch /. Autorelabel # #设置开机后重标记SElinux标签 #exit
No:2
Start the system, press "E" key in the Grub interface, enter edit mode, find the line that starts with "linux16" to replace the RO with RW init=/sysroot/bin Press Ctrl x to start: #chroot /sysroot/ # Echo " liuqi.com "| passwd --stdin root#touch /. Autorelabel#exit#reboot
No:3
Start the system, press "E" key in the Grub interface, enter the edit mode, find the line that starts with "linux16" to replace the RO with RW, and add init=/bin/sh Press CTRL x to start: #Echo "liuqi.com"| passwd --stdin root#touch /. Autorelabel#exit#reboot
No:4 (recommended)
Start the system, in the grub interface by pressing "E" key, enter the editing mode, find the "linux16" beginning of the row Ro replaced with RW, line end add init=/bin/sh /etc/ /sbin/init system restarts, you do not need to use a password to log in, enter the system and then use passwd to modify the root password.
Multiple posture hack CentOS OR readhat Enterprises 7.X Root Password