How to Check whether SELinux is Enabled or Disabled [ID 432988.1]
Applies to:
Linux OS - Version: 4.0 to 5.3 - Release: RHEL4 to OEL5U3Linux x86
Linux x86-64
Linux Itanium
***Checked for relevance on 19-Jan-2011***
Linux Kernel - Version: 4.0 to 5.3
Goal
From (FAQ):Security-enhanced Linux (SELinux) is a reference implementation of the Flask security architecture for flexible mandatory access control. It was created to demonstrate the value of flexible mandatory access controls and how such controls could be added to an operating system. The Flask architecture has been subsequently mainstreamed into Linux® and ported to several other systems, including the Solaris™ operating system, the FreeBSD® operating system, and the Darwin kernel, spawning a wide range of related work. The Flask architecture provides general support for the enforcement of many kinds of mandatory access control policies, including those based on the concepts of Type Enforcement®, Role-based Access Control, and Multi-level Security.RedHat and Oracle Enterprise Linux provides the SELinux functionality. How one can check whether SELinux is enabled on a system or not?
Solution
SELinux may be in three different modes: Enforcing (or known as enabled), Disabled or Permissive.Permissive mode loads the SELinux software, but doesn't enforce the rules, only logging is performed.
use this command to check current status:
# /usr/sbin/getenforce
The output will be either of the 3 options described above. For more verbose (in the case of permissive), use:
# /usr/sbin/sestatus
To programmatically check the status as a true/false, one way could be:
This will return ENABLED or DISABLED.[@more@]# /usr/sbin/selinuxenabled; if [ $? -ne 0 ]; then echo "DISABLED"; else echo "ENABLED"; fi
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/161195/viewspace-1055554/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- QSocketNotifier: Socket notifiers cannot be enabled or disabled from another
- ERROR3948: Loading local data is disabled - this must be enabled on both the client and server sidesErrorclientServerIDE
- How To Turn SNMP On/Off ? [ID 472530.1]
- What is OPAQUE_TRANSFORM Hint and how to Control it [ID 780503.1]OpaqueORM
- How to Collect Diagnostics for Database Hanging Issues (Doc ID 452358.1)Database
- Loaded plugins: product-id, search-disabled-repos, security, subscription-managePlugin
- How to Increase CSS Misscount in single instance ASM installations [ID 729878.1]CSSASM
- 【CURSOR】How to Monitor and tune Open and Cached Cursors (Doc ID 1430255.1)
- ORA-12801 AND ORA-01031 ONLY WHEN OGG DDL TRIGGER IS ENABLED [ID 1280235.1]
- How to redirect to a specific web page after sign out from Entra IDWeb
- How To Replicate Data from Oracle to Postgres Using GoldenGate (Doc ID 1544137.1OracleGo
- SELinux: 如何讓selinux對某些命令放行,自定義selinux規則。Linux
- switch_selinux.sh | 開啟或禁用SELinuxLinux
- jQuery設定disabled屬性與移除disabled屬性jQuery
- SELinux如何永久禁用Linux
- SELinux 安全模型——TELinux模型
- onclick="return check()" 和 onclick="check()" 區別
- 什麼是seLinux?Linux關閉seLinux有什麼影響?Linux
- Linux中selinux是什麼意思?SELinux的主要作用有哪些?Linux
- [20190306]Disabled EZCONNECT.txt
- CSSStyleSheet.disabled 屬性CSS
- jquery-disabled和readonlyjQuery
- CSS E:enabled 選擇器CSS
- CentOS 8 禁用 SELinux 教程CentOSLinux
- Android SELinux許可權AndroidLinux
- Error: php@8.0 has been disabled because it is a versioned formula! It was disabled on 2023-11-29.ErrorPHPORM
- Check if String is HappyAPP
- Nessus提示API Disabled錯誤API
- SELinux簡介和解決方法Linux
- Linux——防火牆、SELinux規則Linux防火牆
- 說說SELinux工作原則Linux
- SELinux的安全上下文Linux
- How to ssh
- CHECK_INTERFACE作用
- check_document_position
- disabled和readonly屬性區別
- SAP WM中階Storage Type的Capacity Check – Usage check based on SUT
- Linux伺服器---關閉selinuxLinux伺服器
- 使用semanage管理SELinux安全策略Linux