How to Disable SELinux in Ubuntu Server/Desktop
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.
Install selinux-policy-default and related packages:
sudo apt-get update
sudo apt-get install selinux-basics selinux-policy-default auditdRun the selinux-activate command:
sudo selinux-activateOpen the /etc/default/rcS file and set FSCKFIX=yes:
FSCKFIX=yesRestart 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的更多相关文章
- Ubuntu Server 与 Ubuntu Desktop之间的区别
服务器版本的内核时钟频率由桌面的100hz转为1khz,这一点是为某些服务器应用提供更好的性能和吞吐量. 除此之外,服务器内核支持SMP"对称多处理"(Symmetrical Mu ...
- Ubuntu Server VS Ubuntu Desktop区别
今天有位朋友问我,Ubuntu Server 与 Ubuntu Desktop的区别在哪里!区别如下: SERVER没有GUI SERVER没有一堆的桌面软件 SERVER在编译时使用的参数不一样,会 ...
- Ubuntu Server 与 Ubuntu Desktop区别
今天有位朋友问我,Ubuntu Server 与 Ubuntu Desktop的区别在哪里!区别如下: SERVER没有GUI SERVER没有一堆的桌面软件 SERVER在编译时使用的参数不一样,会 ...
- Ubuntu Desktop变为Ubuntu Server服务器版的方法
去Ubuntu官网看到有好几种版本可以下载,alternate(文本安装).desktop9(桌面).netbook(上网本).server(服务器). 使用server版某个理由: 32位的系统可以 ...
- Ubuntu Server : 自动更新
Ubuntu(16.04/18.04) 默认会每天自动安装系统的安全更新,但是不会自动安装包的更新.本文梳理 Ubuntu 16.04/18.04 系统的自动更新机制,并介绍如何配置系统自动更新所有的 ...
- 实战Ubuntu Server上配置LXDE+VNC环境
1.安装x-window 使用apt-get 安装 xorg sudo apt-get install xorg 如果提示以下内容,就说明需要update下源列表,使用sudo apt-get upd ...
- 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 ...
- Ubuntu Server修改IP、DNS、hosts
本文记录下Ubuntu Server 16.04修改IP.DNS.hosts的方法 -------- 1. Ubuntu Server 修改IP sudo vi /etc/network/interf ...
- Ubuntu Server忘记密码后,单用户模式修改密码进去不了桌面的无奈
俗话说的好,好记性不如烂笔头.有时候脑子一热,就想不起来之前设置过的密码是什么了.我可怜地忘了我的Ubuntu Server的密码,回忆了n种组合都不行,于是只能进行单用户模式的修改密码了. 以下的操 ...
- 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什么好 ...
随机推荐
- dotnet 的LINQ使用
// LINQ (Language Integrated Qyery) 语言集成查询 -- 用来查询的一些操作类库 // 1. LINQ to Objects 主要负责对象的查询 // 2. LINQ ...
- Nuxt.js 应用中的 kit:compatibility 事件钩子详解
title: Nuxt.js 应用中的 kit:compatibility 事件钩子详解 date: 2024/10/11 updated: 2024/10/11 author: cmdragon e ...
- Idea启动多服务时的Dashboard展示
1.提换.idea/workspace.xml文件中的RunDashboard标签 <component name="RunDashboard"> <option ...
- OpenFunction v1.1.0 发布:新增 v1beta2 API,支持 Dapr 状态管理
OpenFunction 是一个开源的云原生 FaaS(Function as a Service,函数即服务)平台,旨在帮助开发者专注于业务逻辑的研发.在过去的几个月里,OpenFunction 社 ...
- 基于 Python + Vue3!一个轻量级的域名和 SSL 证书监测平台!
大家好,我是 Java陈序员. 在企业开发中,由于业务众多,涉及到很多业务域名证书,证书过期由于遗忘常常未能及时续期,导致线上访问异常,给企业带来损失! 今天,给大家介绍一个轻量级的域名和 SSL 证 ...
- Octave 安装教程
Octave 用心写著. Octave为GNU项目下的开源软件.同时它也是一种语言,专注于解决线性计算问题.因为对于矩阵计算的优化,使得其速度远高于循环计算.语法兼容Linux shell. Octa ...
- SpringBoot入门到精通(十三)日志:别小看它,否则吃亏的是自己!学会你也可以设计架构
别小看他,当你面对的时候,就会知道,多么痛的领悟! 如何在 Spring Boot 中使用 Logback 记录详细的日志? 整合LogBack,Log4J...等,是不是很多方法!但需要注意,我讲的 ...
- three.js+vue智慧社区web3d数字孪生三维地图
案例效果截图如下: 具体案例场景和功能,详见b站视频: https://www.bilibili.com/video/BV1Bb421E7WL/?vd_source=7d4ec9c9275b9c7d1 ...
- Python311新特性-特化指令specializing adaptive interpreter-typing-asyncio
Python3新特性 python3.11增加了许多特性,让python更快更加安全,本文从应用层面来讲一下python3.11的这些新特性 特化自适应解析器是什么,如何利用特化写出更高性能的代码 如 ...
- linux基本指令总结
拖了好久的linux学习,终于开始啦 环境终于没问题了 边学边总结 一.常用指令 1.1 关机与开机 poweroff 马上关机 reboot 马上重启 1.2 目录文件操作命令 cd / 切换到根目 ...