LinuxCommandLibrary

semanage-port

Manage persistent SELinux port definitions.

TLDR

List all port labeling rules

$ sudo semanage port [-l|--list]
copy


List all user-defined port labeling rules without headings
$ sudo semanage port [-l|--list] [-C|--locallist] [-n|--noheading]
copy


Add a user-defined rule that assigns a label to a protocol-port pair
$ sudo semanage port [-a|--add] [-t|--type] [ssh_port_t] [-p|--proto] [tcp] [22000]
copy


Delete a user-defined rule using its protocol-port pair
$ sudo semanage port [-d|--delete] [-p|--proto] [udp] [11940]
copy

Copied to clipboard