Skip to content

Instantly share code, notes, and snippets.

@olmosleo
Last active March 22, 2017 14:29
Show Gist options
  • Save olmosleo/a71af55805d8313af7b0bec9a369a639 to your computer and use it in GitHub Desktop.
Save olmosleo/a71af55805d8313af7b0bec9a369a639 to your computer and use it in GitHub Desktop.
Script Disabled SELINUX on CentOS 6 or 7
#!/bin/bash
# Disabled SELINUX on CentOS 6 o 7 Linux.
SELINUX_CONF="/etc/selinux/config";
echo "# This file controls the state of SELinux on the system." > $SELINUX_CONF;
echo "# SELINUX= can take one of these three values:" >> $SELINUX_CONF;
echo "# enforcing - SELinux security policy is enforced." >> $SELINUX_CONF;
echo "# permissive - SELinux prints warnings instead of enforcing." >> $SELINUX_CONF;
echo "# disabled - No SELinux policy is loaded." >> $SELINUX_CONF;
echo "SELINUX=disabled" >> $SELINUX_CONF;
echo "# SELINUXTYPE= can take one of these two values:" >> $SELINUX_CONF;
echo "# targeted - Targeted processes are protected," >> $SELINUX_CONF;
echo "# mls - Multi Level Security protection." >> $SELINUX_CONF;
echo "SELINUXTYPE=targeted" >> $SELINUX_CONF;
#echo "SELINUX=disabled" > $SELINUX_CONF;
#echo "SELINUXTYPE=targeted" >> $SELINUX_CONF;
reboot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment