【问题标题】:How can I activate SELinux on Ubuntu 20.04.1 LTS如何在 Ubuntu 20.04.1 LTS 上激活 SELinux
【发布时间】:2021-06-05 08:07:58
【问题描述】:

我正在尝试在我的 Ubuntu 20 VPS 上启用 SELinux。我已经根据this article 安装了必要的实用程序,当我运行sudo selinunx-activate 时,它说它已激活,但如果我运行sestatus,它说它已禁用。我尝试重新启动,但它仍然说它之后被禁用。

~$ sudo selinux-activate
Activating SE Linux
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Warning: Setting GRUB_TIMEOUT to a non-zero value when GRUB_HIDDEN_TIMEOUT is set is no longer supported.
Found linux image: /boot/vmlinuz-3.13.0-61-generic
done
SE Linux is activated.  You may need to reboot now.
~$ sestatus
SELinux status:                 disabled

如何激活 SELinux?

【问题讨论】:

标签: ubuntu selinux


【解决方案1】:

编辑/etc/selinux/config 以包含SELINUX=permissive 并重新启动。此模式记录警告但不强制执行,因此您可以解决策略中的任何错误。当您准备好测试时,使用setenforce 1 暂时将 SELinux 置于强制模式,直到使用setenforce 0 改回或重新启动。当您准备好让系统在启动时直接进入强制模式时,将上面的配置文件行更改为 SELINUX=enforcing 并重新启动。

【讨论】:

    猜你喜欢
    • 2021-04-12
    • 2021-03-31
    • 2021-01-14
    • 2021-02-19
    • 1970-01-01
    • 2021-06-09
    • 2021-01-24
    • 2023-03-26
    • 2016-12-22
    相关资源
    最近更新 更多