Get the App
SLTechnology News&Howtos  ›  Servers  › 

What is the command to shut down selinux

Shulou Source: shulou.com Published: 2022-06-03 05:04:50 09月21日 Update

Close selinux

1. Get the selinux status by using the command "getenforce"

[root@localhost ~] # getenforceEnforcing / / enforceing means to enable, [root@localhost ~] # getenforcePermissive / / permissive means to warn [root@localhost ~] # getenforceDisabled / / disabled means to disable [root@localhost ~] #

2. Enter the command at the terminal to shut down selinux, which is only temporarily closed and has no effect after restart.

[root@localhost ~] # setenforce 0 / / close [root@localhost ~] # getenforcePermissive [root@localhost ~] # setenforce 1 / / enable [root@localhost ~] # getenforceEnforcing

3. Modify the selinux status through the configuration file "/ etc/sysconfig/selinux", which 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

4. Close selinux by modifying "/ boot/grub/menu.lst", so that selinux will not be started every time you boot.

[root@localhost ~] # gedit / boot/grub/menu.lst default=0timeout=5splashimage= (hd0,0) / grub/splash.xpm.gzhiddenmenutitle 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

The above are the details of how to close selinux, please pay attention to other related articles!

Tags: Representatives commands practices status content just effects files articles more machines terminals input configuration Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple macOS Microsoft MariaDB Redmi