# SELinux management

### How to get SELinux status<br>

The following command will retreive the SELinux status of your system (output may vary):<br>

```
 sestatus 
```

exemple from CentOS 5.3<br>

```
 SELinux status: enabled
 SELinuxfs mount: /selinux
 Current mode: permissive
 Mode from config file: permissive
 Policy version: 21
 Policy from config file: targeted
```

<br>

### How to disable SELinux<br>

#### Set SELinux to permissive (not truly disabled)<br>

```
 setenforce 0
```

<br>

#### Disable SELinux entirely<br>

Edit the file:<br>

```
 vi /etc/selinux/config
```

Set the line to SELINUX=disabled<br>

```
 # 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 - SELinux is fully disabled.
 SELINUX=disabled                                            <------ Line to modify
 # SELINUXTYPE= type of policy in use. Possible values are:
 #       targeted - Only targeted network daemons are protected.
 #       strict - Full SELinux protection.
 SELINUXTYPE=targeted
```

Reboot or use the setenforce command:<br>

```
shutdown -r now
or
setenforce 0
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://prosbcdocs.telcobridges.com/initial-installation/3.-uploading-a-license/host-control/selinux-management.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
