在CentOS系统中,可以通过以下几种方法查询SELinux的版本:
getenforce
命令getenforce
cat /etc/selinux/config
SELINUX=
这一行,它通常会设置为enforcing
、permissive
或disabled
。虽然这不会显示版本号,但可以确认SELinux是否启用。sestatus
命令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
Max kernel policy version: 31
lsmod | grep selinux
selinux
模块的版本号通常会包含在内。cat /var/log/audit/audit.log | grep selinux
通过以上方法,你应该能够查询到CentOS系统中SELinux的版本信息。