免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2792 | 回复: 0
打印 上一主题 下一主题

如何开启或关闭SELinux [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2010-01-26 19:09 |只看该作者 |倒序浏览

RedHat的 /etc/sysconfig/selinux
在新版本中的Red Hat 和 Fedora 上,修改档案
/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=enforcing
# SELINUXTYPE= type of policy in use. Possible values are:
#       targeted - Only targeted network daemons are protected.
#       strict - Full SELinux protection.
SELINUXTYPE=targeted
把 SELINUX设定为disable, 下次启动系统后将会停止SElinux。
Linux核心参数(Kernel Parameter)
或者可以在核心参数后加上: selinux=0 (停止) 或 selinux=1 (开启)参数
档案
/boot/grub/menu.lst

title Fedora Core (2.6.18-1.2798.fc6)
root (hd0,0)
kernel /vmlinuz-2.6.18-1.2798.fc6 ro root=LABEL=/ rhgb quiet  selinux=0
initrd /initrd-2.6.18-1.2798.fc6.img
检查SELinux现时况态
要知到你现在是否使用 SELinux:
# getenforce
Enforcing


1、快速关闭SElinux,使用如下命令就可以:
  /usr/sbin/setenforce 0 立刻关闭 SELINUX
  /usr/sbin/setenforce 1 立刻启用 SELINUX
  2、加到系统默认启动里面
  echo "/usr/sbin/setenforce 0" >> /etc/rc.local
     3、可以编辑配置文件达到同样的目的
     vi /etc/selinux/conf
     set SELINUX=disabled

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u3/104223/showart_2161535.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP