CentOS 7 closes firewall and selinux

1. Turn off the firewall

1. Temporarily shut down (the next time you boot up, the firewall will start automatically)

systemctl stop firewalld

2. View firewall status

systemctl status firewalld

3. Permanently turn off the firewall (the firewall will no longer be activated when the computer is turned on)

systemctl disable firewalld

Two, close selinux

1. View selinux status

getenforce

# 输出:Enforcing    启动状态
# 输出:Permissive   关闭状态

2. Temporary closure

# 查看关闭命令参数
setenforce

# 输出:usage:  setenforce [ Enforcing | Permissive | 1 | 0 ]     1 表示启动,0 表示关闭

# 临时关闭
setenforce 0

3. Close selinux permanently (modify the configuration file to close permanently)

[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=enforcing         修改为"SELINUX=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

ESC --> :wq 保存

Guess you like

Origin blog.csdn.net/qq_33833327/article/details/130509033