CentOS 禁用 SELinux 方法(临时和彻底关闭)
SELinux 是 Linux 内核的一个安全增强功能,其主要作用是控制程序服务的操作权限,包括对系统服务、网络端口、文件资源方面的访问约束。也因其严格限制策略和复杂配置门槛,一般个人用户很难驾驭。基本装完系统就默认关掉它,不然以后部署服务很容易遇到被限制问题。
查看 SELinux 状态
CentOS 原版系统默认启用 SELinux,可以用sestatus
命令查看。有些主机商可能为了避免用户遇到不必要麻烦,所提供的系统模板默认关闭了 SELinux,阿里云和 Linode 的 CentOS 系统就是这样。
[vpsdp@centos ~]$ sestatus SELinux status: enabled SELinuxfs mount: /selinux Current mode: enforcing Mode from config file: enforcing Policy version: 24 Policy from config file: targeted
彻底关闭 SELinux
修改 SELinux 配置文件/etc/selinux/config
,将SELINUX=enforcing
改为SELINUX=disabled
。
[vpsdp@centos ~]$ sudo vi /etc/selinux/config
# 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:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
也可以直接用下面命令一键设置关闭。
sudo sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
之后sudo reboot
重启系统生效。
临时关闭 SELinux
准确的说,这种方式不是关闭 SELinux,而是切换到permissive模式(不执行 SELinux 安全策略,但打印警告信息)。
# 切换至 permissive 模式 sudo setenforce 0 # 恢复至 enforcing 模式 sudo setenforce 1
运行命令后即时生效,重启不会保存设置。
hydroxychloroquine use in taiwan https://hydroxychloroquine.webbfenix.com/
reliable careprost source https://carepro1st.com/
hydroxychloroquine coronavirus trial results https://hhydroxychloroquine.com/
naltrexone shot for alcohol abuse https://naltrexoneonline.confrancisyalgomas.com/
alternative to ivermectin https://ivermectin.mlsmalta.com/
hydroxychloroquine use for fibromyalgia https://hydroxychloroquine.mlsmalta.com/
recommended dosage for cialis http://www.lm360.us/
vidalista 5mg costco https://vidalista.mlsmalta.com/
ivermectin 3 mg for humans https://ivermectin.webbfenix.com/
is viagra better than sildenafil http://droga5.net/
vidalista canada https://vidalista40mg.mlsmalta.com/
where to buy priligy in usa https://ddapoxetine.com/
cialis vs levitra reviews https://wisig.org/
how does albuterol help bronchitis https://amstyles.com/
chewable viagra and cialis https://tadalafili.com/
over the counter hydroxychloroquine https://hydroxychloroquinee.com/
plaquenil for psoriatic arthritis https://hydroxychloroquine.mymvrc.org/
plaquenil for psoriatic arthritis https://hydroxychloroquine.grassfed.us/
what is better cialis or viagra https://tadalafil365.online/
what is better cialis or viagra https://tadfil.online/
drugs used to prevent malaria https://hydroxychloroquine.grassfed.us/
drugs used to prevent malaria https://hydroxychloroquine.lm360.us/
cheap prescription medications from canada https://medpills.bee-rich.com/
cheap prescription medications from canada https://edmeds.buszcentrum.com/
generic cialis fast delivery https://tadalafil.cleckleyfloors.com/
sildenafil 100 online india https://zsildenafil.com/
best tadalafil brand in india http://ciaalis2u.com/
aurogra 100mg tabs https://aurogra.buszcentrum.com/
cialis destroyer https://cialis.mlsmalta.com/
cialis destroyer https://cialis.webbfenix.com/
generic vidalista pills http://vidallista.com/
tadalafil prescription drugs https://cialis.bee-rich.com/
tadalafil prescription drugs http://cialis.audiovideoninja.com/
pharmacy store https://atadalafil.online/
viagra internet http://viaagra1.com/
best price for viagra 100mg http://viiagra.co/
Hello excellent blog! Does running a blog such as this
take a large amount of work? I have virtually no expertise in programming but I
had been hoping to start my own blog in the near future.
Anyhow, if you have any ideas or techniques for new blog owners please share.
I know this is off subject but I simply wanted to ask. Thanks a lot! http://cleckleyfloors.com/viagra
Right now it appears like Movable Type is the preferred blogging platform available right now.
(from what I’ve read) Is that what you are using on your blog? https://cialis.cleckleyfloors.com/tadalafil
This paragraph is truly a good one it helps new the web visitors, who are wishing in favor
of blogging. https://hydroxychloroquines.studiowestinc.com/
generic soft tabs cialis https://cialis.stdstory.com/
I take pleasure in, result in I discovered exactly what I was
having a look for. You’ve ended my 4 day
long hunt! God Bless you man. Have a nice day. Bye https://hydroxychloroquineg.grassfed.us/