selinux配置文件修改错误导致无法启动虚拟机
Posted wang618
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了selinux配置文件修改错误导致无法启动虚拟机相关的知识,希望对你有一定的参考价值。
selinux配置文件修改错误导致无法启动虚拟机
问题
[root@centos73 ~]# cat /etc/selinux/config # This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced. # permissive - SELinux prints warnings instead of enforcing. # disabled - No SELinux policy is loaded. SELINUX=enforcing # SELINUXTYPE= can take one of three two values: # targeted - Targeted processes are protected, # minimum - Modification of targeted policy. Only selected processes are protected. # mls - Multi Level Security protection. SELINUXTYPE=targeted [root@centos73 ~]# cat /etc/selinux/config ^C [root@centos73 ~]# getenforce Enforcing
[root@centos73 ~]# cat /etc/selinux/config # This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced. # permissive - SELinux prints warnings instead of enforcing. # disabled - No SELinux policy is loaded. SELINUX=enforcing # SELINUXTYPE= can take one of three two values: # targeted - Targeted processes are protected, # minimum - Modification of targeted policy. Only selected processes are protected. # mls - Multi Level Security protection. SELINUXTYPE=disabled [root@centos73 ~]# reboot Connection closed by foreign host. Disconnected from remote host(10.0.0.73:22) at 16:56:13. Type `help‘ to learn how to use Xshell prompt. [c:~]$
解决办法
重启,但是会比较慢,要等好几分钟
默认是单用户模式
[root@centos73 ~]# cat /etc/selinux/config # This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced. # permissive - SELinux prints warnings instead of enforcing. # disabled - No SELinux policy is loaded. SELINUX=disabled # SELINUXTYPE= can take one of three two values: # targeted - Targeted processes are protected, # minimum - Modification of targeted policy. Only selected processes are protected. # mls - Multi Level Security protection. SELINUXTYPE=targeted [root@centos73 ~]# getenforce Disabled [root@centos73 ~]# setenforce 1 setenforce: SELinux is disabled
[root@centos73 ~]# echo 123456 | passwd --stdin root Changing password for user root. passwd: all authentication tokens updated successfully.
注意此文件不需要修改
[root@centos73 ~]# cat /boot/grub2/grub.cfg | grep linux16 linux16 /vmlinuz-3.10.0-862.el7.x86_64 root=UUID=154fb900-77cf-4d55-975f-b788805fe281 ro rhgb quiet net.ifnames=0 biosdevname=0 linux16 /vmlinuz-0-rescue-581a9982f0474ce5bc2d9ba036f3bc8a root=UUID=154fb900-77cf-4d55-975f-b788805fe281 ro rhgb quiet net.ifnames=0 biosdevname=0
以上是关于selinux配置文件修改错误导致无法启动虚拟机的主要内容,如果未能解决你的问题,请参考以下文章
centos 7.3 错误设置selinux 导致不能启动 Failed to load SELinux policy. Freezing