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
  • 207,228

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
  • 119,640
-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
  • 207,228
The T
  • 111