SELinux Modes
SELinux Context
ls -lZ
ls -lZd
man semanage-fcontext
semanage fcontext -a
semanage fcontext -a -e
semnaage fcontext -m
semanage fcontext -l -C
restorecon -Rv <directory> | touch /.autorelebel
difference_between_selinux_fcontext_commands
- use
ls -lZ
to get the context also
systemctl restart httpd
SELinux Port
man semanage-port
semanage port -l
semanage port -a -t http_port_t -p tcp 81
semanage port -a -t ssh_port_t -p tcp 8991
ss -tunap
semanage port -a -t http_port_t -p tcp 82
SELinux Booleans
semanage boolean -l
semanage boolean -l | grep httpd
setsebool -P <boolean> [on|off]
semanage boolean -l -C
getsebool -a
getsebool -a | grep httpd
# -P for making it persistent across boots
setsebool -P httpd_enable_homedirs on