1

How to change selinux modes from permissive to enforcing in ubuntu 14.04.

I tried

# vim /etc/selinux/config
SELINUX=enforcing
save and quiet
# init 6

after that ... no luck. when i execute getenforce command showing Disabled.

muru
  • 193,181
  • 53
  • 473
  • 722
Ravindra Reddy
  • 21
  • 1
  • 1
  • 5

2 Answers2

2

Simply run setenforce 1 as root. One way to do this is to run sudo setenforce 1.

You can verify that it succeeded by running sestatus and examining the output.

[root@ec2-54-183-55-79 filebeat]# setenforce 1
[root@ec2-54-183-55-79 filebeat]# sestatus
SELinux status:                 enabled
SELinuxfs mount:                /sys/fs/selinux
SELinux root directory:         /etc/selinux
Loaded policy name:             targeted
Current mode:                   enforcing
Mode from config file:          enforcing
Policy MLS status:              enabled
Policy deny_unknown status:     allowed
Max kernel policy version:      28
Eliah Kagan
  • 116,445
  • 54
  • 318
  • 493
-2

How about this idea? Open a terminal

sudo -i
cd /etc/selinux/
gedit config

Here is what it looks like:

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=enforcing
# SELINUXTYPE= can take one of these two values:
# default - equivalent to the old strict and targeted policies
# mls     - Multi-Level Security (for military and educational use)
# src     - Custom policy built from source
SELINUXTYPE=ubuntu

# SETLOCALDEFS= Check local definition changes
SETLOCALDEFS=0

Make your changes and save as

muru
  • 193,181
  • 53
  • 473
  • 722
Travis Wells
  • 111
  • 11
  • That looks like what the OP did. I can confirm that setting `SELINUX=enforcing` and rebooting does not work. – Zabba Jun 03 '17 at 04:22