SELinux: Difference between revisions

From Freephile Wiki
No edit summary
m Text replacement - "<(\/?)source" to "<$1syntaxhighlight"
 
Line 6: Line 6:
== Turning Off SELinux ==
== Turning Off SELinux ==
Temporarily turn off SELinux
Temporarily turn off SELinux
<source lang="bash">
<syntaxhighlight lang="bash">
echo 0 > /selinux/enforce
echo 0 > /selinux/enforce
</source>
</syntaxhighlight>
The file itself will be empty, but you'll see something in <code>/var/log/messages</code>
The file itself will be empty, but you'll see something in <code>/var/log/messages</code>
<pre>
<pre>
Line 20: Line 20:
Annoyingly, if you check to see if selinux is enabled, it reports "enabled" even when it's temporarily disabled!?
Annoyingly, if you check to see if selinux is enabled, it reports "enabled" even when it's temporarily disabled!?


<source lang="bash">
<syntaxhighlight lang="bash">
selinuxenabled && echo enabled || echo disabled
selinuxenabled && echo enabled || echo disabled
</source>
</syntaxhighlight>


[[Category:System Administration]]
[[Category:System Administration]]
[[Category:Security]]
[[Category:Security]]

Latest revision as of 13:32, 24 February 2025

see


Turning Off SELinux

Temporarily turn off SELinux

echo 0 > /selinux/enforce

The file itself will be empty, but you'll see something in /var/log/messages

dbus: avc:  received setenforce notice (enforcing=0)

Of course you can also turn it back on with "1" instead of "0".

This temporary change will not persist through a system reboot. You need to modify /etc/selinux/config to make permanent changes.

Annoyingly, if you check to see if selinux is enabled, it reports "enabled" even when it's temporarily disabled!?

selinuxenabled && echo enabled || echo disabled