当前位置:首页 > 操作系统 > Linux

SELinux上课内容

/etc/security/limits.conf         #定义对用户的各种限制

#<domain>        <type>  <item>  <value>     #具体文件中有定义
user4 hard nofile 10             #限制user4最多打开10个文件
user5 hard as 10240           #限制user5只能使用10M内存



MAC:强制访问控制。添加了对应用程序的控制。

/etc/selinux/config    #配置文件

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values: #3种工作模式
#     enforcing - SELinux security policy is enforced.#强制模式
#     permissive - SELinux prints warnings instead of enforcing.#警告模式
#     disabled - No SELinux policy is loaded.
SELINUX=enforcing
# 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. #最高的保护级别。
#如果要使用此级别需要安装一个包。selinux-policy-mls。
SELINUXTYPE=targeted

在强制模式下面,selinux策略生效

在警告模式下面,selinux不会禁用策略,但是会记录下警告信息。

从enforcing切换到permissive,不需要重启,其它都需要重启才行。切换到permissive多用于排错。

[root@localhost ~]# getenforce       #查看目前处于什么模式下
Enforcing
[root@localhost ~]# setenforce 0     #切换到permissive模式
0:permissive模式
1:disable模式



原文:http://chomper.blog.51cto.com/7866214/1694199


【说明】本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!

相关教程推荐

其他课程推荐