semanage Command Examples

SELinux persistent policy management tool. Some subcommands such as boolean, fcontext, port, etc. have their own usage documentation. More information: https://manned.org/semanage.

sudo semanage boolean {{-m|--modify}} {{-1|--on|-0|--off}} {{haproxy_connect_any}}

sudo semanage fcontext {{-a|--add}} {{-t|--type}} {{samba_share_t}} '/mnt/share(/.*)?'

sudo semanage port {{-a|--add}} {{-t|--type}} {{ssh_port_t}} {{-p|--proto}} {{tcp}} {{22000}}

sudo semanage permissive {{-a|--add|-d|--delete}} {{httpd_t}}

sudo semanage export {{-f|--output_file}} {{path/to/file}}

sudo semanage import {{-f|--input_file}} {{path/to/file}}