如何关闭防火墙和selinux

防火墙关闭

[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]# systemctl disable firewalld

关闭selinux

[root@localhost ~]# setenforce 0
[root@localhost ~]# 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=disabled #修改为disabled
# SELINUXTYPE= can take one of three values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are
protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
[root@localhost ~]# getenforce ##查看当前selinux的状态
Disabled
3 Likes

好奇,大部分企业都会关掉selinux吗

我是经常关这个。

sed -i ‘s/SELINUX=enabled/SELINUX=disabled/’ /etc/selinux/config

大佬,有个关于enforce的问题想请教一下,自定义了xxx.service, systemctl start xxx的时候报203,查了一圈,setenforce 0后再start就可以了,请问这个是为什么?能否在不关的情况下可以正常start

可以在不关的情况下正常start

请问 能否举例说明一下,我这边的例子是kingbase,尝试多次还是弄不好。