Manage security Flashcards
how to set firewall zone
firewall-cmd –set-default-zone=dmz
how to allow specific IP/range through firewall
firewall-cmd –permanent –zone=internal –add-source=192.168.0.0/24
how to allow specific service through firewall
firewall-cmd –permanent –zone=internal –add-service=mysql
how to allow specific port through firewall
firewall-cmd –permanent –zone=internal –add-port=1001/tcp
how to save current firewall rules
firewall-cmd –reload
how to list firewall rules by zone
firewall-cmd –permanent –zone=internal –list-all
how to set ACL on a file for a specific user
setfacl -m u:name:rwX file
how to delete all ACL rules on a file
setfacl -x file
how to set ACL on a directory and all files under it
setfacl -R -m d:u:name:rwX directory
how to check ACL’s on a file
getfacl file-A
how to copy ACL’s that one file has to another easily
getfacl file-A | setfacl –set-file=- file-B
how to live change SELinux to enforcing
setenforce 1
how to live change SELinux to permissive
setenforce 0
how to check current status of SELinux
getenforce
where is the file to permanently change SELinux mode
vim /etc/selinux/config