Home > Database > Mysql Tutorial > body text

检查selinux状态的方法

WBOY
Release: 2016-06-07 16:13:14
Original
1746 people have browsed it

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

[root@servera ~]# uname -a
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
[root@servera ~]# sestatus
SELinux status:                 disabled
[root@servera ~]# getenforce
Disabled
[root@servera ~]#
Copy after login

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

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

 

 

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!