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
看看我虚拟机的设置吧:
可是谁知道配置的时候还是遇到了点问题!
尤其是 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
看看我虚拟机的设置吧:
相关文章推荐
- rhel5中不用关闭selinux而成功启动samba的方法
- RHEL5关闭selinux的不同
- [RHEL7.1]关闭防火墙及SElinux
- rhel5中不关闭SeLinux配置SAMBA的方法
- Rhel7.2的网络配置,防火墙、SELinux服务关闭及YUM源配置
- RHEL下关闭SELinux
- RHEL 关闭 SeLinux
- Rhel7.2的网络配置,防火墙、SELinux服务关闭及YUM源配置
- 日记 [2008年04月08日]RHEL5关闭 SELINUX
- rhel7的基本操作(查看IP配置,关闭防火墙,临时或永久关闭selinux,常用命 16ca 令操作)
- RHEL 7关闭防火墙及SElinux
- [RHEL7.1]关闭防火墙及SElinux
- RHEL5中不用关闭SELinux而成功启动Samba
- SElinux的开启和关闭
- 查看SELinux状态及关闭SELinux
- Linux中关闭selinux和firewall
- SELinux查看、启用、关闭
- RHEL7.3关闭防火墙
- CentOS 关闭SELINUX及添加防火墙规则
- linux 每日学一点《Redhat关闭SELinux的正确步骤》