Control SELinux File Contexts Flashcards
What command starts and enables Apache web service?
systemctl enable –now httpd
What command verifies the Apache web service is running?
systemctl status httpd
What command is used to define the SELinux file context rule that sets the context type to httpd_sys_content_t for the /custom directory and all files under it?
semanage fcontext -a -t httpd_sys_content_t ‘/custom(/.*)?’
What command is used to correct the file contexts in the /custom directory?
restorecon -Rv /custom
What command is used to create a public_html directory?
mkdir ~/public_html
What command changes permission of /home/student directory to allow access of public_html folder?
chmod 711 ~
What command is used to see whether any Booleans restrict access to home directories for httpd service?
getsebool -a | grep home
What boolean command is used to enable persistent access to the home directory for httpd service?
setsebool -P httpd_enable_homedirs on