永久禁用SeLinux

我正在运行带Cobbler服务的virtualbox CentOS 6.4(64位)服务器。 其中一个步骤是禁用SeLinux,以防止service cobblers start补丁程序时发生python错误。 如果我运行setenforce 0一切正常,但每次服务器重新启动时都必须运行该命令。 我尝试更改/etc/sysconfig/selinux SELINUX=disabled ,也是SELINUX=permissive然后重新启动,但sestatus不断显示,centOS启动selinux运行。 我需要更改一个不同的configuration文件,或者我不正确地configuration了selinux文件吗?

Youtubevideo显示selinuxconfiguration文件,重新启动,然后检查状态

您需要将其设置在/etc/selinux/config

 # This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced. # permissive - SELinux prints warnings instead of enforcing. # disabled - No SELinux policy is loaded. SELINUX=permissive # SELINUXTYPE= can take one of these two values: # targeted - Targeted processes are protected, # minimum - Modification of targeted policy. Only selected processes are protected. # mls - Multi Level Security protection. SELINUXTYPE=targeted 

内核启动parameter passing给selinux = 0的正确位置在/etc/grub.conf

kernel /boot/vmlinuz-2.6.32-358.2.1.el6.x86_64 ro root=/dev/xvda1 rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us crashkernel=auto console=tty0 selinux=0

PS SELinux应该只设置为permissivedebugging一个问题,运行它permissive看到什么被logging到/var/log/audit.log修复拒绝,然后切换回enforcing不要运行在宽容或长期禁用。

在文件/etc/sysconfig/selinux设置SELINUX=disabled应该足够了。 你也可以从内核中禁用它。 编辑文件/etc/default/grub并将selinux=0添加到GRUB_CMDLINE_LINUXvariables中,并更新您的GRUBconfiguration:

 shell# grub2-mkconfig -o /etc/grub2.cfg 

重新启动后,请检查SELinux状态。 getenforce命令应该打印“ Disabled