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 to turn off selinux in CentOS7

2025-03-13 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

How to turn off selinux in CentOS7? for this question, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible way.

Selinux needs to be turned off when installing Cobbler and Puppet, but usually after downloading and installing CentOS7, SElinux is enabled by default

As follows:

[csharp] view plaincopy

[root@rdo ~] # sestatus

SELinux status: enabled

SELinuxfs mount: / sys/fs/selinux

SELinux root directory: / etc/selinux

Loaded policy name: targeted

Current mode: enforcing

Mode from config file: enforcing

Policy MLS status: enabled

Policy deny_unknown status: allowed

Max kernel policy version: 28

1. If you want to shut down temporarily, you can execute

[cpp] view plaincopy

Setenforce 0

The status at this time is as follows

[html] view plaincopy

[root@rdo ~] # sestatus

SELinux status: enabled

SELinuxfs mount: / sys/fs/selinux

SELinux root directory: / etc/selinux

Loaded policy name: targeted

Current mode: permissive

Mode from config file: enforcing

Policy MLS status: enabled

Policy deny_unknown status: allowed

Max kernel policy version: 28

2. If you want to close permanently, you can modify the configuration file / etc/selinux/config and set SELINU to disabled.

[html] view plaincopy

[root@rdo ~] # 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

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

Modifying the configuration file can also be done by executing the following command

[html] view plaincopy

Sed-I'/ SELINUX/s/enforcing/disabled/' / etc/selinux/config

After the modification is completed, save the restart. The status after restart is as follows:

[html] view plaincopy

[root@rdo ~] # sestatus

SELinux status: disabled

This is the answer to the question about how to close selinux in CentOS7. I hope the above content can be of some help to you. If you still have a lot of doubts to solve, you can follow the industry information channel for more related knowledge.

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