Nov 30

Selinux and Security in Linux

Find out the Selinux packages available

rpm -qa | grep selinux

The output:
libselinux-utils-2.2.2-6.el7.x86_64
libselinux-2.2.2-6.el7.x86_64
selinux-policy-targeted-3.12.1-153.el7.noarch
selinux-policy-3.12.1-153.el7.noarch
libselinux-python-2.2.2-6.el7.x86_64

Install Selinux

yum install policycoreutils policycoreutils-python selinux-policy selinux-policy-targeted libselinux-utils setroubleshoot-server setools setools-console mcstrans

 

 

SELinux Modes

  • Enforcing
  • Permissive
  • Disabled

 

Check Modes:

getenforce
sestatus (some more details)

Related Files:
cat /etc/selinux/config
cat /var/log/messages | grep "SELinux is preventing"
cat /var/log/messages | grep "SELinux"
cat /var/log/messages | grep "SELinux"

Change Modes:

sestatus
setenforce permissive
setenforce enforcing

Check Selinux Modules
semodule -l | less
ls -l /etc/selinux/targeted/modules/active/modules/
ls -l /etc/selinux/targeted/policy/

Change SeLinux Policy
semanage boolean -l | less
setsebool ftpd_anon_write on

Skip to toolbar