• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

getenforce: command not found

by admin

Security-Enhanced Linux (SELinux) is the default context-based permissions scheme provided with CentOS and Red Hat Enterprise Linux, and is optionally available on other distributions. It was developed by the U.S. National Security Agency (NSA). It provides additional file system and network security so that unauthorized processes cannot access or tamper with data, bypass security mechanisms, violate security policies, or execute untrustworthy programs.

There are three types of SELinux modes; they are as follows:

  • Enforcing: In this mode, SELinux enforces its policies onto the system and makes sure that all access by unauthorized users or processes are denied. These access denial events are also logged in to the system as well, which we will look into later on in this chapter.
  • Permissive: This is like a semi-enabled mode state where SELinux doesn’t deny any access as the policies are in permissive mode. This is the best mode to test the SELinux policies.
  • Disabled: In this mode, the SELinux is in a completely disabled state and no logs are created or permissions are denied.

We can run the following commands to get the present SELinux status:

# getenforce
# sestatus

If you encounter the below error while running the getenforce command:

getenforce: command not found

you may try installing the below package as per your choice of distribution:

OS Distribution Command
Debian apt-get install selinux-utils
Ubuntu apt-get install selinux-utils
Kali Linux apt-get install selinux-utils
CentOS yum install selinux-utils
Fedora dnf install selinux-utils
Raspbian apt-get install selinux-utils

Filed Under: Linux

Some more articles you might also be interested in …

  1. diffstat: Create a histogram from the output of the diff command
  2. blastp: command not found
  3. grep: command not found
  4. boltctl: command not found
  5. nmcli: command not found
  6. qm snapshot Command Examples in Linux
  7. pstree: command not found
  8. ark Command Examples in Linux
  9. zcat Command Examples in Linux
  10. CentOS / RHEL : How to make iptable rules persist across reboots

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright