RHCSA Ch7 Flashcards
see the current mode of SELinux
sestatus
and
getenforce
change SELinux mode
setenforce permissive (temporary and only last for that sessions)
edit /etc/selinux/config
change the SELINUX line to whatever mode necessary
get security context for user
id -Z
see security context for all processes
ps -eZ
get security context for files
ls -lZ
change security type of a file
chcon -t etc_t file.txt
change the security type of a file to what the system thinks it should be
restorecon file.txt
reset all security contexts
make a file call /.autorelabel
then reboot
make security context persisent even after relablel
sudo semanage fcontext -a -t etc_t /home/user1/file.txt
list SELinux booleans
getsebool -a
sestatus -b
sudo semanage boolean -l = gives a brief description
change a security boolean
sudo setsebool mozilla_plugin_use_gps on = not persistant
sudo setsebool -P mozilla_plugin_use_gps = persistant
options to keep security contexts cp mv tar rsync
cp -a
mv
tar –selinux
rsync -a X
Interact with farewalld
firewall-cmd
firewall timeout
sudo firewall-cmd –timeout=60
Make a permenant firewall rule
sudo firewall-cmd –permanent