← 返回命令列表

Linux command

setsebool 命令

安全

权限或系统影响较大,执行前请核对目标。

常用示例

Set

sudo setsebool [boolean_name] on

Unset

sudo setsebool [boolean_name] off

Set

sudo setsebool -P [boolean_name] on

Set

sudo setsebool -P [bool1]=[on] [bool2]=[off]

说明

setsebool sets the current state of a particular SELinux boolean or a list of booleans to a given value. Booleans allow runtime customization of SELinux policy without requiring policy modification or recompilation. Values can be specified as 1, true, or on for enabled, or 0, false, or off for disabled. Multiple booleans can be set at once using the bool=value syntax.

参数

-P
Make changes persistent across reboots
-N
Don't reload policy after change
-V
Verbose output

FAQ

What is the setsebool command used for?

setsebool sets the current state of a particular SELinux boolean or a list of booleans to a given value. Booleans allow runtime customization of SELinux policy without requiring policy modification or recompilation. Values can be specified as 1, true, or on for enabled, or 0, false, or off for disabled. Multiple booleans can be set at once using the bool=value syntax.

How do I run a basic setsebool example?

Run `sudo setsebool [boolean_name] on` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -P do in setsebool?

Make changes persistent across reboots