您的位置:首页 > 运维架构 > Linux

RHEL6—关闭 SELinux

2012-06-05 14:13 225 查看
之所以写这篇文章是因为最近重新装了系统,然后换了个 RHEL6 来玩玩!

可是谁知道配置的时候还是遇到了点问题!

尤其是 Samba、NFS、TFTP 等等的配置都是学习嵌入式 Linux 驱动程序的必备品,,如果不关闭掉 SELinux,那么这些东西都不能正常运行(关于如何配置这些应该都是很了解的吧,不知道的 Tell 我,我告诉你啊,呵呵)!

关闭 SELinux 成了必需品的先前条件!

如果想对 SELinux 有进一步的了解,可以查看百度百科(个人感觉 SELinux 就是一个像防火墙似的,只不过安全系数大而已,(*^__^*) 嘻嘻……)

好了,废话不多说了,关闭 SELinux 在 RHEL5 中只要选中 Firewall configeration 中的 SELinux 中的 Disable 就哦了!

但是在 RHEL6 中就要用专门的语言来了!

1)getenforce

  得到当前的SELINUX值

  [root@python bin]# getenforce

  Permissive

2)setenforce

  更改当前的SELINUX值 ,后面可以跟 enforcing,permissive 或者 1, 0。

  [root@python bin]# setenforce permissive

3)sestatus

  显示当前的 SELinux的信息

  [root@python bin]# sestatus -v

  SELinux status: enabled

  SELinuxfs mount: /selinux

  Current mode: permissive

  Mode from config file: permissive

  Policy version: 20

  Policy from config file: refpolicy

  Process contexts:

  Current context: user_u:user_r:user_t

  Init context: system_u:system_r:init_t

  /sbin/mingetty system_u:system_r:getty_t

  /usr/sbin/sshd system_u:system_r:sshd_t

  File contexts:

  Controlling term: user_u:object_r:user_devpts_t

  /etc/passwd system_u:object_r:etc_t

  /etc/shadow system_u:object_r:shadow_t

  /bin/bash system_u:object_r:shell_exec_t

  /bin/login system_u:object_r:login_exec_t

  /bin/sh system_u:object_r:bin_t -> system_u:object_r:shell_exec_t

  /sbin/agetty system_u:object_r:getty_exec_t

  /sbin/init system_u:object_r:init_exec_t

  /sbin/mingetty system_u:object_r:getty_exec_t

看看我虚拟机的设置吧:

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: