<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h3 class="title">
      <a name="selinux-mode">
      </a>
      8.7.2 Changing the SELinux Mode
     </h3>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045231636704">
  </a>
  <p>
   SELinux supports enforcing, permissive, and disabled modes.
      Enforcing mode is the default. Permissive mode allows operations
      that are not permitted in enforcing mode and logs those operations
      to the SELinux audit log. Permissive mode is typically used when
      developing policies or troubleshooting. In disabled mode, polices
      are not enforced, and contexts are not applied to system objects,
      which makes it difficult to enable SELinux later.
  </p>
  <p>
   To view the current SELinux mode, use the
   <span class="command">
    <strong>
     sestatus
    </strong>
   </span>
   command mentioned previously or the
   <span class="command">
    <strong>
     getenforce
    </strong>
   </span>
   utility.
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-simple"><div class="docs-select-all right" id="sa96750137"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-simple">$<span class="token operator">&gt;</span> getenforce
Enforcing</code></pre>
  </div>
  <p>
   To change the SELinux mode, use the
   <code class="literal">
    setenforce
   </code>
   utility:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-simple"><div class="docs-select-all right" id="sa25181167"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-simple">$<span class="token operator">&gt;</span> setenforce 0
$<span class="token operator">&gt;</span> getenforce
Permissive</code></pre>
  </div>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-simple"><div class="docs-select-all right" id="sa20009524"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-simple">$<span class="token operator">&gt;</span> setenforce 1
$<span class="token operator">&gt;</span> getenforce
Enforcing</code></pre>
  </div>
  <p>
   Changes made with
   <span class="command">
    <strong>
     setenforce
    </strong>
   </span>
   are lost when you
      restart the system. To permanently change the SELinux mode, edit
      the
   <code class="filename">
    /etc/selinux/config
   </code>
   file and restart the
      system.
  </p>
 </div>
 <br/>
</div>
