Skip to content

Instantly share code, notes, and snippets.

@2-718
Created November 30, 2010 19:01
Show Gist options
  • Save 2-718/722182 to your computer and use it in GitHub Desktop.
Save 2-718/722182 to your computer and use it in GitHub Desktop.
SELinux Commands

Status

$ sestatus
SELinux status:                 enabled
SELinuxfs mount:                /selinux
Current mode:                   enforcing
Mode from config file:          enforcing
Policy version:                 21
Policy from config file:        targeted

$ getenforce
Enforcing

Disable

# setenforce 0

Enable

# setenforce 1

List policies

# semodule -l
aisexec 1.0.0
amavis  1.1.0
...
virt    1.2.1
zosremote       1.0.0

Modify policy (for example, to allow Phusion Passenger to function)

# grep httpd /var/log/audit/audit.log | audit2allow -M passenger
# semodule -i passenger.pp
# setenforce 1

Remove policy

# semodule -r passenger
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment