Turn on SELinux in Redhat or CentOS Linux Over Remote SSH Session

www‮.‬lautturi.com
Turn on SELinux in Redhat or CentOS Linux Over Remote SSH Session

To turn on SELinux on a Red Hat or CentOS Linux system over a remote SSH session, follow these steps:

  1. Connect to the system via SSH as the root user.

  2. Edit the /etc/selinux/config file by running the following command:

nano /etc/selinux/config
  1. Find the following line in the file:
SELINUX=disabled
  1. Change the line to the following:
SELINUX=enforcing
  1. Save the file and exit the editor.

  2. Run the following command to apply the changes:

setenforce enforcing
  1. Reboot the system for the changes to take effect:
reboot

SELinux will now be enabled on the system.

Note: If you want to set SELinux to permissive mode instead of enforcing mode, change the SELINUX line to SELINUX=permissive and run the setenforce permissive command. In permissive mode, SELinux will log actions that would be denied in enforcing mode, but it will not actually enforce the rules.

Created Time:2017-10-16 14:38:54  Author:lautturi