2024-05-27 02:28:37 +08:00
|
|
|
# setsebool
|
|
|
|
|
|
|
|
> Set SELinux boolean value.
|
|
|
|
> See also: `semanage-boolean`, `getsebool`.
|
2024-09-18 20:42:03 +02:00
|
|
|
> More information: <https://manned.org/setsebool>.
|
2024-05-27 02:28:37 +08:00
|
|
|
|
|
|
|
- Show the current setting of [a]ll booleans:
|
|
|
|
|
|
|
|
`getsebool -a`
|
|
|
|
|
|
|
|
- Set or unset a boolean temporarily (non-persistent across reboot):
|
|
|
|
|
|
|
|
`sudo setsebool {{httpd_can_network_connect}} {{1|true|on|0|false|off}}`
|
|
|
|
|
2025-03-27 16:42:21 +02:00
|
|
|
- Set or unset a boolean [P]ersistently:
|
2024-05-27 02:28:37 +08:00
|
|
|
|
|
|
|
`sudo setsebool -P {{container_use_devices}} {{1|true|on|0|false|off}}`
|
|
|
|
|
2025-03-27 16:42:21 +02:00
|
|
|
- Set or unset multiple booleans [P]ersistently at once:
|
2024-05-27 02:28:37 +08:00
|
|
|
|
|
|
|
`sudo setsebool -P {{ftpd_use_fusefs=1 mount_anyfile=0 ...}}`
|
|
|
|
|
|
|
|
- Set or unset a boolean persistently (alternative method using `semanage-boolean`):
|
|
|
|
|
2025-03-09 01:35:31 +02:00
|
|
|
`sudo semanage boolean {{[-m|--modify]}} {{-1|--on|-0|--off}} {{haproxy_connect_any}}`
|