SELinux tolerant mode (permissive) forced mode (enforcing) off (disabled)

Source: Internet
Author: User

SELinux has a total of 3 states.
1. SELinux configuration file:/etc/selinux/config
# This file controls the state of the SELinux on the system.
3 # selinux= can take one of these three values:
4 # Enforcing-selinux Security policy is enforced.
5 # Permissive-selinux Prints warnings instead of enforcing.
6 # Disabled-no SELinux policy is loaded.
7 selinux=permissive
8 # selinuxtype= can take one of three the values:
9 # targeted-targeted processes is protected,
Ten # Minimum-modification of targeted policy. Only selected processes is protected.
# Mls-multi level Security protection.
selinuxtype=targeted

Enforcing: Mandatory mode, on behalf of the SELinux operation, and has correctly begun to limit domain/type; permissive: Tolerance mode: Represents SELinux operation, but only a warning message does not actually restrict domain/type access. This model can be shipped as the use of SELinux debug;
disabled: Off, SELinux does not actually work.
2. Check the status of SELinux now:
Sestatus
3, permanently change the status of SELinux, need to re-boot, because SELinux is integrated into the kernel module.
4. Temporary Closure Selinux:setenforce 0
5, temporarily open, from permissive to Enforcing:setenforce 1
6. Use the SED command to modify the SELinux configuration file:
Sed-i '/selinux/s/enforcing/disabled/'/etc/selinux/config
Explanation:/selinux/is a line containing characters that match in//
S is the replacement command
Sed-i indicates that the source file is modified directly, and no-I simply outputs the modification to standard output and does not modify the source file.
S/the string to look for/changed string/
Note that the entire command is enclosed in single quotation marks.
Finally, keep up with the file name

SELinux tolerant mode (permissive) forced mode (enforcing) off (disabled)

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.