https://www.configserverfirewall.com/ubuntu-linux/disable-selinux-ubuntu/

In this tutorial I will explain how to configure SELinux on Ubuntu Operating system. SELinux or Security Enhanced Linux is an additional layer of security services on top of the standard Linux DAC Mechanism and brings further protection to your Linux operating System By denying everything that has not been specifically allowed.

Security Enhanced Linux is an implementation of the Mandatory Access Control Mechanism of the Linux kernel. Mandatory Access Control is an additional layer of security added to top of the standard Discretionary Access Control (User/Group based permissions).

Even though it's has been added to provide additional security to the Linux operating system, most administrators prefer to disable SELinux because without proper configuration, some application will not run when SELinux is enabled.

So how do we disable SELinux on Ubuntu?

There is no need. SELinux is not installed by default in Ubuntu. Security Enhanced Linux is primarily used by the Red Hat based Linux distributions, that includes Red Hat Enterprise Linux, CentOS and Fedora.

Debian based distributions, including Ubuntu do not deliver SELinux by default, instead they use a system called AppArmor for Mandatory Access Control (AppArmor is disabled by default on Ubuntu).

Install SELinux on Ubuntu

The following steps describe how to install and configure SELinux on Ubuntu/Debian.

  1. Install selinux-policy-default and related packages:

    sudo apt-get update
    sudo apt-get install selinux-basics selinux-policy-default auditd
  2. Run the selinux-activate command:

    sudo selinux-activate
  3. Open the /etc/default/rcS file and set FSCKFIX=yes:

    FSCKFIX=yes
  4. Restart the computer (it will take a while to reboot):

    sudo systemctl reboot

After the system rebooted, run the check-selinux-installation command to make sure that the installation is successful.

Enable and Disable SELinux on Ubuntu

By default SELinux on Ubuntu run in permissive mode. To enable SELinux, Open the /etc/selinux/config file and set SELINUX=enforcing:

SELINUX=enforcing

Then, Save the config file and restart the computer:

sudo systemctl reboot

If you want to permanently disable SELinux, set SELINUX=disabled and restart the computer.

You need to restart your Ubuntu system every time you switch between enforcing and disabled modes permanently.

To view The SELinux status on Ubuntu, Type:

sestatus

To check current running mode, Type:

getenforce

Run setenforce command to switch between Enforcing and Permissive mode without having to restart the computer (Enforcing = 1, Permissive = 0).

setenforce 0

Summary

  • SELinux is a security enhancement for the Linux kernel, and is Originally developed by the National Security Agency's office of Information Assurance as an enhancement to Linux Security.
  • If you use CentOS, Fedora or RHEL, SELinux is enabled by default.
  • Apparmor is the default way of implementing Mandatory Access Control in Debian/Ubuntu based Linux distributions.

How to Disable SELinux in Ubuntu Server/Desktop的更多相关文章

  1. Ubuntu Server 与 Ubuntu Desktop之间的区别

    服务器版本的内核时钟频率由桌面的100hz转为1khz,这一点是为某些服务器应用提供更好的性能和吞吐量. 除此之外,服务器内核支持SMP"对称多处理"(Symmetrical Mu ...

  2. Ubuntu Server VS Ubuntu Desktop区别

    今天有位朋友问我,Ubuntu Server 与 Ubuntu Desktop的区别在哪里!区别如下: SERVER没有GUI SERVER没有一堆的桌面软件 SERVER在编译时使用的参数不一样,会 ...

  3. Ubuntu Server 与 Ubuntu Desktop区别

    今天有位朋友问我,Ubuntu Server 与 Ubuntu Desktop的区别在哪里!区别如下: SERVER没有GUI SERVER没有一堆的桌面软件 SERVER在编译时使用的参数不一样,会 ...

  4. Ubuntu Desktop变为Ubuntu Server服务器版的方法

    去Ubuntu官网看到有好几种版本可以下载,alternate(文本安装).desktop9(桌面).netbook(上网本).server(服务器). 使用server版某个理由: 32位的系统可以 ...

  5. Ubuntu Server : 自动更新

    Ubuntu(16.04/18.04) 默认会每天自动安装系统的安全更新,但是不会自动安装包的更新.本文梳理 Ubuntu 16.04/18.04 系统的自动更新机制,并介绍如何配置系统自动更新所有的 ...

  6. 实战Ubuntu Server上配置LXDE+VNC环境

    1.安装x-window 使用apt-get 安装 xorg sudo apt-get install xorg 如果提示以下内容,就说明需要update下源列表,使用sudo apt-get upd ...

  7. Compiling Xen-4.4 From Source And Installing It On Ubuntu Server (Amd-64)

    First of all, you should install a clean Ubuntu Server (Amd-64) on your server. (Version 14.04 is st ...

  8. Ubuntu Server修改IP、DNS、hosts

    本文记录下Ubuntu Server 16.04修改IP.DNS.hosts的方法 -------- 1. Ubuntu Server 修改IP sudo vi /etc/network/interf ...

  9. Ubuntu Server忘记密码后,单用户模式修改密码进去不了桌面的无奈

    俗话说的好,好记性不如烂笔头.有时候脑子一热,就想不起来之前设置过的密码是什么了.我可怜地忘了我的Ubuntu Server的密码,回忆了n种组合都不行,于是只能进行单用户模式的修改密码了. 以下的操 ...

  10. Ubuntu Server 14.04 LTS(64bit)已安装 weblogic Server 12c(12.1.3) Zip Distribution

    这里说的对Ubuntu Server 14.04 LTS(64bit)已安装weblogic Server 12c(12.1.3) Zip Distribution遇到的问题.至于Windows什么好 ...

随机推荐

  1. LinearRegression线性回归

    1.LinearRegression将方程分为两个部分存放,coef_存放回归系数,intercept_则存放截距,因此要查看方程,就是查看这两个变量的取值. 2.回归系数(regression co ...

  2. vagrant文件基础配置

    Vagrant.configure("2") do |config| config.vm.box = "centos7" # box 名称 config.vm. ...

  3. JOI Open 2017(口胡)

    T1 Amusement Park 题意:通信题.给定一张 \(n\) 个点 \(m\) 条边的无向连通图.Alice 会得到一个 \([0, 2^{60})\) 中的数 \(x\),并且她需要给这张 ...

  4. KubeSphere 社区双周报 | 4.8 深圳站 Meetup 火热报名中 | 2023.3.17-3.30

    KubeSphere 社区双周报主要整理展示新增的贡献者名单和证书.新增的讲师证书以及两周内提交过 commit 的贡献者,并对近期重要的 PR 进行解析,同时还包含了线上/线下活动和布道推广等一系列 ...

  5. ToDesk云电脑堪比万元PC?黑悟空、老头环及战锤40K实测体验!

    2009年,OnLive首次在旧金山游戏开发者大会推出"云游戏"的概念,但受限于当时的网络宽带技术,云游戏并不被十分看好.现如今,5G时代已然到来,数据通量和画质传输给予云游戏崛起 ...

  6. Java高并发synchronized讲解生产者消费者

    问题描述 题目:两个线程操作一个变量,实现两个线程对同一个资源一个进行加1操作,另外一个进行减1操作,且需要交替实现,变量的初始值为0.即两个线程对同一个资源进行加一减一交替操作.话不多说,开干首先我 ...

  7. 文件操作(C语言)

    1. 为什么使用文件? 如果没有文件,我们写的程序的数据是存储在电脑的内存中,如果程序退出,内存回收,数据就丢失了,等再次运行程序,是看不到上次程序的数据的,如果要将数据进行持久化的保存,我们可以使用 ...

  8. BAT之shutdown命令

    今天想让电脑开机后固定时间后重启,但之前只用过关机的命令,就去查询资料,并将shutdown的命令用法整体记录一下. 1 ::取消关机 2 shutdown -a 3 4 ::关机 5 shutdow ...

  9. 局部加权回归(Lowess)

    代码示例:(源自:https://blog.csdn.net/weixin_71158509/article/details/136060826) import numpy as np import ...

  10. QOJ 5020. 举办乘凉州喵,举办乘凉州谢谢喵

    QOJ 5020. 举办乘凉州喵,举办乘凉州谢谢喵 飞天数据结构. 思路 设 \(f[u][k]\) 为 \(u\) 子树内距离 \(u\) 小于等于 \(k\) 的点的个数,\(g[u][k]\) ...