selinux配置文件修改错误导致无法启动虚拟机
问题
[[email protected] ~]# 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 [[email protected] ~]# cat /etc/selinux/config ^C [[email protected] ~]# getenforce Enforcing
[[email protected] ~]# 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 [[email protected] ~]# 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:\~]$
解决办法
重启,但是会比较慢,要等好几分钟
默认是单用户模式
[[email protected] ~]# 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 [[email protected] ~]# getenforce Disabled [[email protected] ~]# setenforce 1 setenforce: SELinux is disabled
[[email protected] ~]# echo 123456 | passwd --stdin root Changing password for user root. passwd: all authentication tokens updated successfully.
注意此文件不需要修改
[[email protected] ~]# 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
原文地址:https://www.cnblogs.com/wang618/p/12012494.html
时间: 2024-11-08 11:10:53