setsebool(8)

๐Ÿ“ฆ
version 3.11 ยท 2 versions
, in centos-stream 10, centos-stream 9, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu questing, ubuntu resolute, ubuntu stonking

โœจ setsebool(8) โœจ

okay bestie, gather round, because setsebool(8) is literally the little command that flips SELinux booleans on and off and it's giving main character energy ๐Ÿ’…


๐ŸŽ€ NAME ๐ŸŽ€

setsebool โ€” set SELinux boolean value. that's it. that's the job. she sets booleans. iconic behavior fr fr ๐Ÿฆ‹


๐ŸŒธ SYNOPSIS ๐ŸŒธ

setsebool [ -PNV ] boolean value | bool1=val1 bool2=val2 ...

๐Ÿ’– DESCRIPTION ๐Ÿ’–

so like, setsebool sets the current state of a particular SELinux boolean โ€” or a whole list of booleans, because why do one when you can do many โ€” to a given value. slay.

and the value? it's flexible bestie:

  • 1, true, or on โ†’ enable the boolean โœจ
  • 0, false, or off โ†’ disable it ๐Ÿ’€

now here's the part you actually need to hear, no cap:

  • Without the -P option, only the current boolean value is affected. the boot-time default settings are not changed. so yeah, it'll vibe for now and then forget everything after a reboot ๐Ÿ™ˆ
  • If the -P option is given, all pending values are written to the policy file on disk. meaning they'll be persistent across reboots. this is the one you want if you're tired of redoing your work every single time, periodt ๐Ÿ‘‘
  • If the -N option is given, the policy on disk is not reloaded into the kernel. noted.
  • If the -V option is given, verbose error messages will be printed from the semanage libraries. so when something goes wrong you get the whole story instead of a cryptic little nothing ๐Ÿซถ

โญ EXAMPLE โญ

Enable container_use_devices boolean (will return to persistent value after reboot) โ€” so it's cute for now but it's not staying ๐Ÿ’…

# setsebool container_use_devices 1

Persistently enable samba_create_home_dirs and samba_enable_home_dirs booleans โ€” two at once, using the bool=val format, and with -P so it actually sticks around ๐Ÿ”ฅ

# setsebool -P samba_create_home_dirs=on samba_enable_home_dirs=on

๐Ÿ’œ AUTHOR ๐Ÿ’œ

This manual page was written by Dan Walsh <dwalsh@redhat.com>. The program was written by Tresys Technology. give them their flowers ๐ŸŒธ


๐ŸŒˆ SEE ALSO ๐ŸŒˆ


and that's the whole page bestie, go forth and flip those booleans responsibly ๐Ÿ’–

signing off with the receipts: dwalsh@redhat.com ยท 11 Aug 2004 ยท setsebool(8) โ€” mwah, love u, bye ๐ŸŽ€โœจ๐Ÿฆ‹