linux:selinux_cheatsheet
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
linux:selinux_cheatsheet [2023/02/27 14:19] – created dodger | linux:selinux_cheatsheet [2023/02/27 14:25] (current) – dodger | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== [CHEATSHEET] selinux ====== | ====== [CHEATSHEET] selinux ====== | ||
+ | ====== Binaries ====== | ||
+ | ===== Add path as binaries to allow execution ===== | ||
+ | <code bash> | ||
+ | semanage fcontext -a -t bin_t '/ | ||
+ | </ | ||
+ | |||
+ | ===== Change security context of files/ | ||
+ | <code bash> | ||
+ | chcon -Rv -u system_u -t bin_t '/ | ||
+ | </ | ||
+ | |||
+ | ===== List defined paths by context ===== | ||
+ | |||
+ | <code bash> | ||
+ | | ||
+ | </ | ||
+ | |||
+ | |||
+ | ===== Restore Default Security Contexts ===== | ||
+ | Over 1 file: | ||
+ | <code bash> | ||
+ | restorecon -v / | ||
+ | </ | ||
+ | |||
+ | or to recursively restore the default security contexts for the whole directory: | ||
+ | <code bash> | ||
+ | restorecon -Rv / | ||
+ | </ | ||
====== Networking ====== | ====== Networking ====== | ||
Line 16: | Line 44: | ||
</ | </ | ||
+ | ===== Empty ===== | ||
+ | <code bash> | ||
+ | |||
+ | </ |
linux/selinux_cheatsheet.1677507574.txt.gz · Last modified: 2023/02/27 14:19 by dodger