systemctl stop firewalld systemctl disable firewalld
systemctl status firewalld
[root@server ~]# systemctl status firewalld.service ● firewalld.service - firewalld - dynamic firewall daemon Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled) Active: active (running) since Mon 2020-12-14 15:24:39 CST; 4s ago Docs: man:firewalld(1) Main PID: 1625 (firewalld) CGroup: /system.slice/firewalld.service └─1625 /usr/bin/python -Es /usr/sbin/firewalld --nofork -... Dec 14 15:24:38 server.study.vv systemd[1]: Starting firewalld - dyn... Dec 14 15:24:39 server.study.vv systemd[1]: Started firewalld - dyna... Hint: Some lines were ellipsized, use -l to show in full.
systemctl stop firewalld systemctl status firewalld --- 操作完成确认
[root@server ~]# systemctl stop firewalld.service [root@server ~]# systemctl status firewalld.service ● firewalld.service - firewalld - dynamic firewall daemon Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled) Active: inactive (dead) Docs: man:firewalld(1) Dec 14 15:24:38 server.study.vv systemd[1]: Starting firewalld - dyn... Dec 14 15:24:39 server.study.vv systemd[1]: Started firewalld - dyna... Dec 14 15:26:43 server.study.vv systemd[1]: Stopping firewalld - dyn... Dec 14 15:26:43 server.study.vv systemd[1]: Stopped firewalld - dyna... Hint: Some lines were ellipsized, use -l to show in full.
systemctl disable firewalld
systemctl is-active firewalld --- 检查服务是否正常运行 [root@server ~]# systemctl is-active firewalld.service unknown systemctl is-enabled firewalld --- 检查确认服务是否开机运行 [root@server ~]# systemctl is-enabled firewalld.service disabled
setenforce 0 sed -i.bak s/'^SELINUX=enforcing$'/'SELINUX=disabled'/g /etc/selinux/config
getenforce --- 确认selinux服务是否开启或是关闭
[root@server ~]# getenforce Enforcing
setenforce [1|0] --- 1表示临时开启Enforcing,0表示临时关闭Permissive getenforce --- 关闭后确认
[root@server ~]# setenforce 0 [root@server ~]# getenforce Permissive
修改/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
[root@server ~]# vi /etc/selinux/config SELINUX=disabled
[root@server ~]# reboot
[root@server ~]# getenforce Disabled