如何启用或者禁用SELinux

如何启用或者禁用SELinux,参考“开发指南”的章节“44.2.7. Enable or Disable SELinux”:

  http://www.RedHat.com/docs/manuals/enterprise/RHEL-5-manual/Deployment_Guide-en-US/sec-sel-enable-disable.html

禁用SELinux方法有两种:

  1、命令方式下编辑/etc/sysconfig/selinux,把SELINUX=permissive改成SELINUX=disabled。需要提醒的是,修改SELINUX或者SELINUXTYPE后,只有在下次重启机器的时候修改方可生效。

[root@host2a ~]# cat /etc/sysconfig/selinux

# 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 - SELinux is fully disabled.

SELINUX=permissive

# SELINUXTYPE= type of policy in use. Possible values are:

# targeted - Only targeted network daemons are protected.

# strict - Full SELinux protection.

SELINUXTYPE=targeted

# SETLOCALDEFS= Check local definition changes

SETLOCALDEFS=0

 

posted @ 2015-01-22 16:37  勿妄  阅读(809)  评论(0编辑  收藏  举报