1.基本SELINUX安全性概念
SELINUX ( 安全增强型 Linux ) 是可保护你系统安全性的额外机制。
在某种程度上 , 它可以被看作是与标准权限系统并行的权限系统。在常规模式中 , 以用户身份运行进程 , 并且系统上的文件和其他资源都设置了权限 ( 控制哪些用户对哪些文件具有哪些访问权SELINUX 的另一个不同之处在于 , 若要访问文件 ,你必须具有普通访问权限和 SELINUX 访问权限。因此 , 即使以超级用户身份root 运行进程 , 根据进程以及文件或资源的 SELinux 安全性上下文可能拒绝访问文件或资源限 ) 标签。
2.selinux 的开机状态
[root@localhost ~]# vim /etc/sysconfig/selinux
SELINUX=enforcing|permissive|disabled
enforcing ##开启状态下的强制状态
permissive ##开启状态下的警告状态
Disabled ##关闭状态
[root@localhost ~]# getenforce ##查看selinux状态
更改selinux开机状态
3.selinux 安全上下文访问规则
[root@localhost ~]# yum install vsftpd lftp -y
[root@localhost ~]# systemctl start vsftpd
[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]# touch /mnt/westos3
[root@localhost ~]# mv /mnt/westos3 /var/ftp/
[root@localhost ~]# ls /var/ftp/