# getsebool

查询SElinux策略内各项规则的布尔值

## 补充说明

**getsebool命令** 是用来查询SElinux策略内各项规则的布尔值。SELinux的策略与规则管理相关命令：seinfo命令、sesearch命令、getsebool命令、setsebool命令、semanage命令。

### 语法

```
getsebool [-a] [布尔值条款]
```

### 选项

```
-a：列出目前系统上面的所有布尔值条款设置为开启或关闭值。
```

### 实例

查询本系统内所有的布尔值设置状况：

```
getsebool -a
NetworkManager_disable_trans --> off
allow_console_login --> off
allow_cvs_read_shadow --> off
allow_daemons_dump_core --> on
....(底下省略)....
```

查询httpd\_enable\_homedirs是否为关闭，若没关闭，请关闭它：

```
getsebool httpd_enable_homedirs
setsebool -P httpd_enable_homedirs=0    # 0是关闭  1是开启
```


---

# 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://hezhiqiang.gitbook.io/linux/ming-ling/getsebool.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.
