Disable Selinux Temporarily

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Gabriel9999
    New Member
    • Jul 2019
    • 15

    Disable Selinux Temporarily

    I want to dislabe SeLinux but this will be temporary where after reboot it should be enabled.-
  • cetpainfotech
    New Member
    • Jan 2023
    • 15

    #2
    To temporarily disable SELinux, you can use the command "setenforce 0". This command sets SELinux to permissive mode, which disables the enforcement of SELinux policies but still logs any violations.

    To make sure SELinux is enabled after reboot, you can add the command "setenforce 1" to a script that runs at startup.

    Here are the steps to disable SELinux temporarily and enable it after reboot:

    1. Run the command "setenforce 0" to temporarily disable SELinux.

    2. Create a script that runs at startup. You can create a script in /etc/rc.d/init.d/ or /etc/rc.local

    3. Add the command "setenforce 1" to the script you created.

    4. Make the script executable by running the command "chmod +x /path/to/script"

    5. Add the script to the startup process, this will vary based on your distro.

    6. Reboot your system to test if SELinux is enabled after reboot.

    It's important to keep in mind that SELinux is a security feature, and it's generally a good idea to keep it enabled. If you're experiencing problems with SELinux, it's usually best to try to troubleshoot and resolve the issues rather than disabling it.

    Comment

    Working...