查看防火墙的状态
打开终端输入如下命令
systemctl status firewalld
如图所示:running表示防火墙目前处于打开状态

输入命令进行关闭防火墙:
systemctl stop firewalld

如图所示正常的用户是没有权限的,需要输入管理员的密码才能够进行关闭防火墙。那么就要在终端进行用户切换。
2.切换用户
使用如下命令切换到root
su root

如图所示,输入su root之后,再输入root对应的密码,就切换到root用户了。
这里解释一下su 和root
su:
在linux中,su是“switch user”的缩写,是切换用户的意思,su命令用于变更为其他使用者的身份;使用该命令时,除 root 外,需要键入该使用者的密码。
root:
root权限,类似于Windows系统中的Administrator,root是Linux系统中的超级管理员用户帐户,该帐户拥有整个系统的最高权限,可方便地对于系统的部件进行删除或更改。
3.关闭防火墙
输入命令进行关闭防火墙:
systemctl stop firewalld

再输入下面命令查看防火墙的状态,如上图所示防火墙处理dead状态,表示已关闭。
systemctl status firewalld
4.永久关闭防火墙
上述关闭防火墙是暂时的,在重启虚拟机之后,防火墙又自动开启了,那么我们可以根据需要,使用如下命令将防火墙:
systemctl disable firewalld