Skip to content

Instantly share code, notes, and snippets.

@abner
Forked from Hellyna/selinux-cheatsheet.md
Created November 23, 2016 19:19
Show Gist options
  • Select an option

  • Save abner/87973c673795fca047be1eafa731151f to your computer and use it in GitHub Desktop.

Select an option

Save abner/87973c673795fca047be1eafa731151f to your computer and use it in GitHub Desktop.
SELinux Cheatsheet

SELinux Cheatsheet

Change context: chcon

chcon -u 'something_u' -r 'something_r' -t 'something_t' file
chcon -R -u 'something_u' -r 'something_r' -t 'something_t' dir
chcon --reference 'file_with_target_context' file
chcon -R --reference 'file_with_target_context' dir

Restore context: restorecon

restorecon -F file
restorecon -RF dir

semanage

semanage is provided by policycoreutils-python package.

@abner
Copy link
Author

abner commented Nov 23, 2016

Para o apache no CentOS / Redhat Enterprise permitir escrever log em uma pasta personalizada:

Erro AH0035 -

chcon --reference /var/log/httpd/error_log /var/www/domain.name/error.log
chcon --reference /var/log/httpd/access_log /var/www/domain.name/access.log

ou

https://www.centos.org/forums/viewtopic.php?t=47396&start=10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment