在Ubuntu系统中查看SELinux的状态,可以按照以下步骤操作:
sestatus
命令打开终端:
Ctrl + Alt + T
打开终端。执行命令:
sestatus
并按回车键。示例输出:
SELinux status: enabled
SELinuxfs mount: /sys/kernel/security
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
Max kernel policy version: 31
/etc/selinux/config
文件打开终端:
Ctrl + Alt + T
。查看配置文件:
cat /etc/selinux/config
并按回车键。SELINUX=enforcing
或 SELINUX=disabled
来确定SELinux的当前状态。示例内容:
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# 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 three values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
getenforce
命令打开终端。
执行命令:
getenforce
并按回车键。示例输出:
Enforcing
apt
)进行安装。/etc/selinux/config
文件中的SELINUX=enforcing
来启用它。希望以上方法能帮助你顺利查看Ubuntu系统的SELinux状态!