Linux服务器---关闭selinux
发布日期:2021-08-22 06:43:10
浏览次数:5
分类:技术文章
本文共 1334 字,大约阅读时间需要 4 分钟。
关闭selinux
1、通过命令“getenforce”获取selinux状态,
[root@localhost ~]# getenforce
Enforcing //enforceing代表开启,
[root@localhost ~]# getenforce
Permissive // permissive代表警告
[root@localhost ~]# getenforce
Disabled //disabled代表关闭
[root@localhost ~]#
2、在终端输入命令即可关闭selinux,此种做法只是暂时关闭,重启之后没有效果
[root@localhost ~]# setenforce 0 //关闭
[root@localhost ~]# getenforce
Permissive
[root@localhost ~]# setenforce 1 //开启
[root@localhost ~]# getenforce
Enforcing
3、通过配置文件“/etc/sysconfig/selinux”来修改selinux状态,此种做法需要重启机器
[root@localhost ~]# gedit /etc/sysconfig/selinux
# 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=disabled
4、通过修改“/boot/grub/menu.lst”来关闭selinux,这样每次开机都不会启动selinux
[root@localhost ~]# gedit /boot/grub/menu.lst
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.32-431.el6.i686)
root (hd0,0)
kernel /vmlinuz-2.6.32-431.el6.i686 ro root=/dev/mapper/VolGroup-lv_root nomodeset rd_NO_LUKS rd_NO_MD rd_LVM_LV=VolGroup/lv_swap crashkernel=auto vga=ask LANG=zh_CN.UTF-8 rd_LVM_LV=VolGroup/lv_root KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet selinux=0
initrd /initramfs-2.6.32-431.el6.i686.img
1、通过命令“getenforce”获取selinux状态,
[root@localhost ~]# getenforce
Enforcing //enforceing代表开启,
[root@localhost ~]# getenforce
Permissive // permissive代表警告
[root@localhost ~]# getenforce
Disabled //disabled代表关闭
[root@localhost ~]#
2、在终端输入命令即可关闭selinux,此种做法只是暂时关闭,重启之后没有效果
[root@localhost ~]# setenforce 0 //关闭
[root@localhost ~]# getenforce
Permissive
[root@localhost ~]# setenforce 1 //开启
[root@localhost ~]# getenforce
Enforcing
3、通过配置文件“/etc/sysconfig/selinux”来修改selinux状态,此种做法需要重启机器
[root@localhost ~]# gedit /etc/sysconfig/selinux
# 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=disabled
4、通过修改“/boot/grub/menu.lst”来关闭selinux,这样每次开机都不会启动selinux
[root@localhost ~]# gedit /boot/grub/menu.lst
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.32-431.el6.i686)
root (hd0,0)
kernel /vmlinuz-2.6.32-431.el6.i686 ro root=/dev/mapper/VolGroup-lv_root nomodeset rd_NO_LUKS rd_NO_MD rd_LVM_LV=VolGroup/lv_swap crashkernel=auto vga=ask LANG=zh_CN.UTF-8 rd_LVM_LV=VolGroup/lv_root KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet selinux=0
initrd /initramfs-2.6.32-431.el6.i686.img
转载地址:https://blog.csdn.net/weixin_33738555/article/details/89586233 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!
发表评论
最新留言
逛到本站,mark一下
[***.202.152.39]2024年04月28日 15时28分37秒
关于作者
喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!
推荐文章
pytorch训练cifar10数据集查看各个种类图片的准确率
2019-04-30
Python鼠标点击图片,获取点击点的像素坐标
2019-04-30
路径规划(一) —— 环境描述(Grid Map & Feature Map) & 全局路径规划(最优路径规划(Dijkstra&A*star) & 概率路径规划(PRM&RRT))
2019-04-30
RRT算法(快速拓展随机树)的Python实现
2019-04-30
D*算法
2019-04-30
强化学习(四) —— Actor-Critic演员评论家 & code
2019-04-30
RESTful API
2019-04-30
优化算法(四)——粒子群优化算法(PSO)
2019-04-30
数据在Oracle中的存储
2019-04-30
轨迹规划 trajectory planning
2019-04-30
AGV自动导引运输车
2019-04-30
Trie树(字典树)
2019-04-30
COMP7404 Machine Learing——KNN
2019-04-30