Advertisement
sandervanvugt

RHCSA all you need to know about SELinux for RHCSA

May 12th, 2022
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. [root@localhost ~]# history
  2. 1 history
  3. 2 systemctl status httpd
  4. 3 getenforce
  5. 4 grep AVC /var/log/audit/audit.log
  6. 5 journalctl | grep sealert
  7. 6 sealert -l 4b3286d7-c665-444a-8a83-7f98648061af | less
  8. 7 semanage port -a -t http_port_t -p tcp 82
  9. 8 systemctl restart httpd
  10. 9 systemctl status httpd
  11. 10 history
  12. 11 vim /etc/httpd/conf/httpd.conf
  13. 12 mkdir /web
  14. 13 echo hello > /web/index.html
  15. 14 systemctl restart httpd
  16. 15 curl localhost:82
  17. 16 getenforce
  18. 17 grep AVC /var/log/audit/audit.log
  19. 18 ls -Z /var/www
  20. 19 man semanage-fcontext
  21. 20 # semanage fcontext -a -t httpd_sys_content_t "/web(/.*)?"
  22. 21 # restorecon -R -v /web
  23. 22 semanage fcontext -a -t httpd_sys_content_t "/web(/.*)?"
  24. 23 restorecon -Rv /web
  25. 24 curl localhost:82
  26. 25 journalctl | grep sealert
  27. 26 sealert -l b21de9d6-4db0-46da-b1a1-4050ada199ad | less
  28. 27 history
  29.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement