How to turn off selinux

May 29, 2020 am 11:43 AM
selinux

How to turn off selinux

How to turn off selinux?

Close selinux

1. Get the selinux status through the command "getenforce",

Recommendation: "linux Tutorial

[root@localhost ~]# getenforce
Enforcing        //enforceing代表开启,
 
[root@localhost ~]# getenforce
Permissive      // permissive代表警告
 
[root@localhost ~]# getenforce
Disabled        //disabled代表关闭
[root@localhost ~]#
Copy after login

2. Enter the command in the terminal to shut down selinux. This method is only a temporary shutdown and will have no effect after restarting.

[root@localhost ~]# setenforce 0    //关闭
[root@localhost ~]# getenforce
Permissive         
 
[root@localhost ~]# setenforce 1    //开启
[root@localhost ~]# getenforce
Enforcing
Copy after login

3. Through the configuration file" /etc/sysconfig/selinux" to modify the selinux status. This method 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
Copy after login

4. Turn off selinux by modifying "/boot/grub/menu.lst" so that it will not work every time you turn on the computer. Start selinux

[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
Copy after login

The above is the detailed content of How to turn off selinux. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

What is SELinux What is SELinux Feb 08, 2023 am 11:56 AM

SELinux refers to security-enhanced Linux. It is a security subsystem of Linux. It is designed to enhance the security of the traditional Linux operating system and solve various permission problems in the discretionary access control (DAC) system of the traditional Linux system (such as excessive root permissions). higher). SELinux uses a mandatory access control (MAC) system, which controls whether a process has access rights to files or directories on a specific file system.

An in-depth analysis of the three policy types of SELinux An in-depth analysis of the three policy types of SELinux Feb 26, 2024 pm 10:24 PM

Detailed explanation of the three policy types of SELinux and code examples SELinux (Security-EnhancedLinux) is a security subsystem that implements mandatory access control on the Linux operating system. It ensures the security of the system by defining mandatory access rules for each operation. In SELinux, there are three main policy types: Enforcing, Permissive, and Disabled. This article will introduce these three in detail

Familiar with the three working modes of SELinux Familiar with the three working modes of SELinux Feb 26, 2024 pm 03:27 PM

SELinux (Security-EnhancedLinux) is a security module that implements Mandatory Access Control (MAC) in Linux systems. It enforces security policies by applying labels to system objects (files, processes, etc.) for more fine-grained access control. SELinux has three working modes: Enforcing, Permissive and Disabled. This article will introduce these three modes in detail and provide specific code examples. 1

A Deep Dive into SELinux: A Comprehensive Analysis A Deep Dive into SELinux: A Comprehensive Analysis Feb 26, 2024 pm 01:18 PM

What is SELinux? This article explains in detail that SELinux (Security-EnhancedLinux) is a security-enhanced Linux system security extension module designed to improve the security of the Linux operating system. By implementing a Mandatory Access Control (MAC) mechanism, SELinux can limit program access and protect the system from malware and attackers. In this article, we will explain in detail how SELinux works and provide specific code examples to

linux selinux what is linux selinux what is Apr 06, 2023 am 11:18 AM

linux selinux is the National Security Agency's implementation of mandatory access control and is the most outstanding new security subsystem in the history of Linux; SELinux is the mandatory access control system provided in the 2.6 version of the Linux kernel; most people who use SELinux use Is a SELinux-ready distribution such as Fedora, Red Hat Enterprise Linux, Debian or Centos.

Study the three policy types of SELinux Study the three policy types of SELinux Feb 26, 2024 pm 05:03 PM

SELinux is a security-enhanced Linux operating system security module. Its core is to improve system security through mandatory access control. In SELinux, policy types are an important part of defining security policies. According to different needs and scenarios, SELinux provides three different policy types, namely MLS (Multi-LevelSecurity), TE (TypeEnforcement), RBAC (Role- BasedAcc

Analyze the working mode of SELinux Analyze the working mode of SELinux Feb 26, 2024 pm 05:21 PM

Title: SELinux working mode analysis and code examples In modern computer systems, security has always been a crucial aspect. In order to protect servers and applications from malicious attacks, many operating systems provide a security mechanism called SELinux (Security-EnhancedLinux). SELinux is a mandatory access control (MAC) system that can implement fine-grained access control to system resources. This article will analyze the working mode of SELinux

What are the methods to view policy rules in SELinux? What are the methods to view policy rules in SELinux? Mar 02, 2023 am 10:19 AM

How to view policy rules in SELinux: 1. Use the seinfo command to query how many relevant rules the SELinux policy provides. Whether a subject process can read the target file resources focuses on the SELinux policy and the rules in the policy. The syntax " seinfo [option]"; 2. Use the sesearch command to query the specific content of SELinux policy rules, the syntax is "sesearch [option] [rule type] [expression]".

See all articles