Update cheatsheets

This commit is contained in:
ivuorinen
2024-05-27 00:14:40 +00:00
parent 0e4d52bcd0
commit 369eb89f11
8 changed files with 140 additions and 0 deletions

26
tldr/linux/semanage-port Normal file
View File

@@ -0,0 +1,26 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# semanage port
> Manage persistent SELinux port definitions.
> See also: `semanage`.
> More information: <https://manned.org/man/semanage-port>.
- List all port labeling rules:
`sudo semanage port {{-l|--list}}`
- List all user-defined port labeling rules without headings:
`sudo semanage port {{-l|--list}} {{-C|--locallist}} {{-n|--noheading}}`
- 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}}`
- Delete a user-defined rule using its protocol-port pair:
`sudo semanage port {{-d|--delete}} {{-p|--proto}} {{udp}} {{11940}}`