Background: Cent so7.4root user password forgotten, according to the https://www.linuxidc.com/Linux/2016-08/134034.htm provided by the release method after modifying the password after the system started to stay in the circular interface (CentOS GUI version).
A line error occurred during startup:faild to load SELinux policy freezing,
Finally found the previous learning materials, re-modify the password or report the same error:
Workaround:
1. Restart the page by pressing E to enter the Grub edit page;
2. Find the Linux line, after the last language, space plus selinux=0
3. Then CTRL + X re-run.
4. Before restarting, Ls/etc/selinux found a config~ file, it should be the problem of this file, the config~ file deleted;
5. Reboot restart
With CentOS7 single-user mode change Password:
1. Press E to edit this OS boot menu when the boot menu appears
2. Locate the RO field in the linux16 field, change the Ro field to RW init=/sysroot/bin/sh, or add rd.break directly at the tail//*ramdisk=rd
3.Ctrl + x Launch this change
4. Switch to/sysroot (i.e. physical '/' partition)
#mount-O Remount,rw/sysroot
#chroot/sysroot/bin/bash
5. Change the root password
#passwd
6. If SELinux is turned on, you will need to create the. autorelabel file on the '/' partition
#touch/.autorelabel is used to change all the associated tags of SELinux to accept the new root password
Execute ' exit ' to exit Chroot
Perform ' reboot ' reboot Rhel/centos7
Reference Link: http://www.cnblogs.com/cocoajin/p/4089105.html
Remember the failure to change the password once CentOS7 into single user mode (faild to load SELinux policy freezing)