转自mos文章 检查selinux状态的方法

本文发布时间: 2019-Mar-22
检查selinux状态的方法:来源于:How to Check whether SELinux is Enabled or Disabled (文档 ID 432988.1)selinux 有3种模式:Enforcing (or known as enabled), Disabled or Permissive.Permissive mode loads the SELinux software, but doesn't enforce the rules, only logging is performed.可以使用如下的命令来检查selinux的状态:[root@servera ~]# uname -aLinux servera 2.6.18-308.el5 #1 SMP Fri Jan 27 17:17:51 EST 2012 x86_64 x86_64 x86_64 GNU/Linux[root@servera ~]# sestatusSELinux status: disabled[root@servera ~]# getenforceDisabled[root@servera ~]#若是放在程序中判断selinux的状态,请使用如下的命令:[root@servera ~]# /usr/sbin/selinuxenabled; if [ $? -ne 0 ]; then echo "DISABLED"; else echo "ENABLED"; fiDISABLED


(以上内容不代表本站观点。)
---------------------------------
本网站以及域名有仲裁协议。
本網站以及域名有仲裁協議。

2024-Mar-04 02:09pm
栏目列表