Disable selinux and selinux

Source: Internet
Author: User

Disable selinux and selinux

1. View The SELinux status:Getenforce

Enforcing)

Disable)

1. Disable SELinux (it will still take effect after restart)

Modify vi/etc/sysconfig/selinux

[Root @ developer ~] # Vi/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

# SELINUXTYPE = can take one of these two values:
# Targeted-Targeted processes are protected,
# Mls-Multi Level Security protection.
SELINUXTYPE = targeted

Change the value of The SELINUX item to disable and enable the SELinux service.
Change to SELINUX = disable to disable SeLinux
Change to SELINUX = enforcing and use SeLinux
Or
Vi/etc/selinux/conf
Set SELINUX = disabled

2. Do not restart to make it take effect

/Usr/sbin/setenforce 0 Immediately disable SELINUX

/Usr/sbin/setenforce 1 enable SELINUX immediately

3. Add it to the default startup of the system.

Echo "/usr/sbin/setenforce 0">/etc/rc. local

Echo "/usr/sbin/setenforce 0">/etc/rc. local

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.