6.7. 验证 SELinux 强制


Security-Enhanced Linux (SELinux)是 Linux 内核中强制访问控制机制的实现,在检查标准自由访问控制后检查允许的操作。SELinux 可以强制对 Linux 系统中文件和进程的规则,并根据定义的策略对其操作强制执行规则。

默认情况下,RHEL 8 安装启用了 SELinux。SELinux 策略必须设置为 Enforcing

  • 验证当前的 SELinux 模式:

    # /usr/sbin/getenforce
    
      Enforcing
    Copy to Clipboard Toggle word wrap
    # /usr/sbin/sestatus
    
    SELinux status:                 enabled
    SELinuxfs mount:                /sys/fs/selinux
    SELinux root directory:         /etc/selinux
    Loaded policy name:             targeted
    Current mode:                   enforcing
    Mode from config file:          enforcing
    Policy MLS status:              enabled
    Policy deny_unknown status:     allowed
    Memory protection checking:     actual (secure)
    Max kernel policy version:      33
    Copy to Clipboard Toggle word wrap
  • 可选 :如果要将策略设置为 Enforcing

    # /usr/sbin/setenforce 1
    
      Enforcing
    Copy to Clipboard Toggle word wrap
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat