码迷,mamicode.com
首页 > 系统相关 > 详细

selinux配置文件修改错误导致无法启动虚拟机

时间:2019-12-09 19:58:14      阅读:338      评论:0      收藏:0      [点我收藏+]

标签:user   for   one   minimum   perm   odi   process   grep   xshell   

 

 

 

 

 

 

 


 

 

 

 

 

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配置文件修改错误导致无法启动虚拟机

标签:user   for   one   minimum   perm   odi   process   grep   xshell   

原文地址:https://www.cnblogs.com/wang618/p/12012494.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!