> For the complete documentation index, see [llms.txt](https://hezhiqiang.gitbook.io/linux/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hezhiqiang.gitbook.io/linux/ming-ling/getsebool.md).

# 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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://hezhiqiang.gitbook.io/linux/ming-ling/getsebool.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
