Filters
Zo zoek je
  • Gewone woorden vinden namen, teksten en voorbeelden.
  • "twee woorden" vindt precies die zin.
  • --naam of -x vindt een optie.
  • #woord zoekt alleen in commando's.
  • @grep vindt lessen en labs die grep gebruiken.
  • Filters: cat:network · in:labs · in:notes · level:rhcsa · ch:8 · root:yes. Zet ! voor een woord om het weg te laten. OR tussen woorden betekent één ervan.
  • ↑ ↓ bewegen · Enter openen · Esc sluiten · / zoeken

sestatus

Show the full SELinux status: on or off, current and config mode, policy name and version.

Niveau
RHCSA-examen
Groep
SELinux en beveiliging
Root nodig
Nee
Pakket
policycoreutils

Dit deel is nog niet vertaald. Je ziet de Engelse tekst.

Wat het doet

sestatus prints whether SELinux is enabled, the loaded policy (targeted on RHEL), the current mode and the mode in the config file. With -b it lists all booleans; with -v it shows the contexts of the files and processes named in /etc/sestatus.conf.

Zo schrijf je het

sestatus [-v] [-b]

Opties 2

Meest gebruikt

-v
Also show contexts of files and processes from /etc/sestatus.conf.
-b
Also show all booleans and their state.

Voorbeelden 10

$ als gewone gebruiker# als root (of met sudo)

  1. 1Full status

    sestatus
    SELinux status:                 enabled
    SELinuxfs mount:                /sys/fs/selinux
    Loaded policy name:             targeted
    Current mode:                   enforcing
    Mode from config file:          enforcing

    Current and config mode should both be enforcing.

  2. 2Mode mismatch

    sestatus | grep -i mode

    Current permissive but config enforcing = someone ran setenforce 0.

  3. 3With booleans

    sestatus -b | grep httpd

    State of the httpd booleans.

  4. 4Contexts of important files and processes

    sestatus -v

    Shows labels of /etc/passwd, /bin/bash, init and others.

  5. 5Check the policy type

    sestatus | grep 'Loaded policy'

    targeted = only selected services are confined (RHEL default).

  6. 6Policy version

    sestatus | grep 'Max kernel policy version'

    For support cases.

  7. 7In a compliance script (security)

    sestatus | awk -F: '/Current mode/ {gsub(/ /,"",$2); print $2}'
    enforcing

    Clean value for a report.

  8. 8Is MLS used?

    sestatus | grep -i mls

    Policy MLS status: enabled (also in targeted, for MCS labels).

  9. 9After disabling, nothing is shown

    sestatus
    SELinux status:                 disabled

    Coming back needs a relabel.

  10. 10Deny unknown classes

    sestatus | grep -i deny_unknown

    How the kernel handles unknown permissions.

Exitcodes

0Done.
1Error.

Volledige handleiding

Deze pagina legt het commando uit in eenvoudige woorden. De originele handleiding heeft elk detail.

In je terminal: man 8 sestatus