关闭防火墙并设置开机不启动

查看防火墙状态
[root@localhost hello]# systemctl status firewalld

关闭防火墙
[root@localhost hello]# systemctl stop firewalld.service

开启防火墙
[root@localhost hello]# systemctl start firewalld.service

开机不启动 //重启虚机后,再次检查firewall的状态
[root@localhost hello]# systemctl disable firewalld.service

开机启动 //重启虚机后,再次检查firewall的状态
[root@localhost hello]# systemctl enable firewalld.service

临时和永久关闭SELinux
https://ywnz.com/linux/getenforce/

永久关闭
[root@localhost hello]# vim /etc/selinux/config

1 
2 # This file controls the state of SELinux on the system.
3 # SELINUX= can take one of these three values:
4 #     enforcing - SELinux security policy is enforced.
5 #     permissive - SELinux prints warnings instead of enforcing.
6 #     disabled - No SELinux policy is loaded.
7 
8 SELINUX=disabled # 永久关闭
9 #SELINUX=enforcing
10 
11 # SELINUXTYPE= can take one of three values:
12 #     targeted - Targeted processes are protected,
13 #     minimum - Modification of targeted policy. Only selected processes are protec    ted. 
14 #     mls - Multi Level Security protection.
15 SELINUXTYPE=targeted

修改完后必须重启服务
[root@localhost hello]# reboot

posted @ 2021-03-06 16:50  王^.^令  阅读(706)  评论(0)    收藏  举报