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

How does the Linux server shut down selinux

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

Share

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

This article mainly explains "how the Linux server shuts down selinux". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how to shut down selinux on the Linux server".

Close selinux

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

[root@localhost ~] # getenforce

Enforcing / / enforceing is enabled.

[root@localhost ~] # getenforce

Permissive / / permissive stands for warning

[root@localhost ~] # getenforce

Disabled / / disabled represents shutdown

[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 / / off

[root@localhost ~] # getenforce

Permissive

[root@localhost ~] # setenforce 1 / / on

[root@localhost ~] # getenforce

Enforcing

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=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

Thank you for your reading, the above is the content of "how the Linux server shuts down selinux". After the study of this article, I believe you have a deeper understanding of how the Linux server shuts down selinux, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

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