咏月东南 2019-12-09
[ ~]# 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 [ ~]# cat /etc/selinux/config ^C [ ~]# getenforce Enforcing
[ ~]# 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 [ ~]# 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:\~]$
重启,但是会比较慢,要等好几分钟
默认是单用户模式
[ ~]# 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 [ ~]# getenforce Disabled [ ~]# setenforce 1 setenforce: SELinux is disabled
[ ~]# echo 123456 | passwd --stdin root Changing password for user root. passwd: all authentication tokens updated successfully.
注意此文件不需要修改
[ ~]# 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