我们以防火墙服务为例,其他都相似。
启动防火墙的命令可以是:
systemctl start firewalld
也可以是:
systemctl restart firewalld
代表重启
查看防火墙的状态:
systemctl status firewalld
那么我们可以先启动服务再查看服务信息:
systemctl start firewalld
systemctl status firewalld
命令执行结果:
总结:图中用红色的框框起来的,也就是高亮单词的地方,running代表正在运行中
关闭服务再查看信息
systemctl stop firewalld
systemctl status firewalld
总结:图中用红色的框框起来的,dead代表防火墙服务已经关闭
那么如何永久关闭防火墙服务呢?也就是开机禁用防火墙自启
systemctl disable firewalld
同理让防火墙启用开机自启:
systemctl enable firewalld.service