How to turn off selinux

藏色散人
Release: 2020-05-29 11:43:40
Original
6124 people have browsed it

How to turn off selinux

How to turn off selinux?

Close selinux

1. Get the selinux status through the command "getenforce",

Recommendation: "linux Tutorial

[root@localhost ~]# getenforce Enforcing //enforceing代表开启, [root@localhost ~]# getenforce Permissive // permissive代表警告 [root@localhost ~]# getenforce Disabled //disabled代表关闭 [root@localhost ~]#
Copy after login

2. Enter the command in the terminal to shut down selinux. This method is only a temporary shutdown and will have no effect after restarting.

[root@localhost ~]# setenforce 0 //关闭 [root@localhost ~]# getenforce Permissive [root@localhost ~]# setenforce 1 //开启 [root@localhost ~]# getenforce Enforcing
Copy after login

3. Through the configuration file" /etc/sysconfig/selinux" to modify the selinux status. This method requires restarting the machine

[root@localhost ~]# gedit /etc/sysconfig/selinux # 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
Copy after login

4. Turn off selinux by modifying "/boot/grub/menu.lst" so that it will not work every time you turn on the computer. Start selinux

[root@localhost ~]# gedit /boot/grub/menu.lst default=0 timeout=5 splashimage=(hd0,0)/grub/splash.xpm.gz hiddenmenu title CentOS (2.6.32-431.el6.i686) root (hd0,0) kernel /vmlinuz-2.6.32-431.el6.i686 ro root=/dev/mapper/VolGroup-lv_root nomodeset rd_NO_LUKS rd_NO_MD rd_LVM_LV=VolGroup/lv_swap crashkernel=auto vga=ask.UTF-8 rd_LVM_LV=VolGroup/lv_root KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet selinux=0 initrd /initramfs-2.6.32-431.el6.i686.img
Copy after login

The above is the detailed content of How to turn off selinux. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!