甚么是Selinux
Selinux(SecurityEnhancedLinux)是一个基于安全策略管理访问控制的Linux内核模块,用于实现更强大的安全保护控制。它增强了系统的安全性,可以限制进程的访问和操作文件、目录等资源的权限。
Selinux状态有哪几种
Selinux有三种状态:
怎么查看Selinux状态
以下是深入了解当前Selinux状态的方法:
输入命令`getenforce`可以获得当前Selinux状态。以下所示:
getenforce该命令将输出当前Selinux状态(Enforcing/Permissive/Disabled)。
输入命令`sestatus`可以查看Selinux状态和相关配置信息。以下所示:
sestatus它将输出类似以下内容:
SELinuxstatus:enabledSELinuxfsmount:/sys/fs/selinuxSELinuxrootdirectory:/etc/selinuxLoadedpolicyname:targetedCurrentmode:enforcingModefromconfigfile:enforcingPolicyMLSstatus:enabledPolicydeny_unknownstatus:allowedMemoryprotectionchecking:actual(secure)Maxkernelpolicyversion:28Selinux确当前状态也能够在配置文件中找到。
在Centos7上,Selinux的配置文件为`/etc/selinux/config`。通过编辑此文件,可以改变Selinux状态。以下所示:
cat/etc/selinux/config在此文件中,可以找到以下内容:
ThisfilecontrolsthestateofSELinuxonthesystem.SELINUX=cantakeoneofthesethreevalues:enforcing-SELinuxsecuritypolicyisenforced.permissive-SELinuxprintswarningsinsteadofenforcing.disabled-NoSELinuxpolicyisloaded.SELINUX=enforcingSELINUXTYPE=cantakeoneofthesetwovalues:targeted-Targetedprocessesareprotected,mls-MultiLevelSecurityprotection.SELINUXTYPE=targeted从该文件中,可以查找当前Selinux状态和相关配置信息。
桂@哥@网@络www.guIgegE.cn
TOP