Remember the failure to change the password once CentOS7 into single user mode (faild to load SELinux policy freezing)

Source: Internet
Author: User

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.