Solve the problem of Faild to load SELinux poilcy being unable to enter the CentOS7 system due to an error in modifying the SELINUX configuration file.

1. Problem

Recent learning Kubernetes,needs 设置永久关闭SELINUX,results , 修改错了一个SELINUX配置参数leading 关机重新启动后to 无法进入CentOS7系统,.卡在启动进度条界面
Insert image description here

2. Solve

After restarting several times, it was found in the startup log Faild to load SELinux poilcythat it should be 修改错了一个SELINUX配置参数, causing 无法加载SELINUX相关配置。and affecting the normal startup of the system.
Insert image description here

2.1 Operation

Restart the CentOS7 system. In this interface, 按e键- means edit the selected itemediting the selected entry.
Insert image description here

2.2 Add selinux=0 to temporarily close selinux configuration

Use 向下的方向键, find 以 linux16开头的那一段配置, 段末尾处add a configuration sentence, 空格键隔开 selinux=0
and then press ctrl xthe key combination to express start.
This configuration selinux=0is 临时关闭selinux的配置equivalent to execution setenforce 0. Insert image description here正确配置It should look like the picture below:
Insert image description here
成功进入系统:
Insert image description here

2.3 Reset to permanently close SELINUX

vi /etc/sysconfig/selinux

Will 因为修改SELINUX配置文件出错导致Faild to load SELinux poilcy无法进入CentOS7系统, 错误配置SELINUXTYPE=disabled删除, 重新进行配置设置永久关闭SELINUXthat is 配置SELINUX=disabled.
Insert image description here
正确配置It should look like the picture below:
Insert image description here
Use the cat command 查看是否修改成功:cat /etc/sysconfig/selinux
Insert image description here

2.4 Restart the system

There are no errors in the startup log Faild to load SELinux poilcy. :
Insert image description hereInsert image description here
成功进入登录界面
Insert image description here
成功登录(root用户在名为freedomdjc主机上登录成功),问题成功解决
Insert image description here

Guess you like

Origin blog.csdn.net/qyfx123456/article/details/132947093