Turn off SELinux functionality

Source: Internet
Author: User


Turn off SELinux functionality

1. Permanently closed

1.1 Check, Backup

Permanently close SELinux

1. Pre-operation Backup
Cat/etc/selinux/config

# This file controls the state of the 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
# selinuxtype= can take one of these the values:
# targeted-targeted processes is protected,
# Mls-multi level Security protection.
selinuxtype=targeted
Cp/etc/selinux/config/etc/selinux/config.bak
Ls-l/etc/selinux/config*
-rw-r--r--. 1 root root 458 Jul 11:02/etc/selinux/config
-rw-r--r--. 1 root root 458 Jul 02:08/etc/selinux/config.bak

2.sed Modify, look at the results, do not add-I

This file controls the state of the SELinux on the system.
Selinux= can take one of these three values:
Enforcing-selinux has been activated.
Permissive SELinux Temporary deactivation will display a warning
Disabled-selinux completely shut down no longer running
Selinux=enforcing modified to Disabled

3. Modifying the SELinux configuration

Cat/etc/selinux/config

This file controls the state of the SELinux onthe system.

Selinux= can take one of these threevalues:

Enforcing-selinux security policy is enforced.

Permissive-selinux prints warnings instead of enforcing.

Disabled-no SELinux policy is loaded.

Selinux=disabled

Selinuxtype= can take one of these twovalues:

Cat/etc/selinux/config

This file controls the state of the SELinux onthe system.

Selinux= can take one of these threevalues:

Enforcing-selinux security policy is enforced.

Permissive-selinux prints warnings instead of enforcing.

Disabled-no SELinux policy is loaded.

Selinux=disabled

Selinuxtype= can take one of these twovalues:

4. Temporarily close SELinux

Temporarily close SELinux

1. View SELinux Status
Getenforce
Enforcing

2. Turn off SELinux
Setenforce
Usage:setenforce [Enforcing | Permissive | 1 | 0]
Setenforce 0
Getenforce
Permissive
3. Failure after restarting the server


This article is from the "Heyong" blog, make sure to keep this source http://heyong.blog.51cto.com/13121269/1954573

Turn off SELinux functionality

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.