当前位置:Gxlcms > mysql > 检查selinux状态的方法

检查selinux状态的方法

时间:2021-07-01 10:21:17 帮助过:68人阅读

检查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 doesnt enf

检查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的状态:

  1. [root@servera ~]# uname -a
  2. Linux servera 2.6.18-308.el5 #1 SMP Fri Jan 27 17:17:51 EST 2012 x86_64 x86_64 【本文来自鸿网互联 (http://www.68idc.cn)】x86_64 GNU/Linux
  3. [root@servera ~]# sestatus
  4. SELinux status: disabled
  5. [root@servera ~]# getenforce
  6. Disabled
  7. [root@servera ~]#

若是放在程序中判断selinux的状态,请使用如下的命令:

  1. [root@servera ~]# /usr/sbin/selinuxenabled; if [ $? -ne 0 ]; then echo "DISABLED"; else echo "ENABLED"; fi
  2. DISABLED

人气教程排行