Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the command to shut down selinux

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

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!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report