centos关闭防火墙和关闭服务自启动

一、查看防火墙运行状态

systemctl |grep firewalld.service


查看其他服务运行状态

systemctl |grep [服务进程的名称]

二、关闭防火墙

systemctl stop firewalld.service


关闭其他的服务进程

systemctl stop [服务进程的名字]

三、关闭防火墙自启动服务

systemctl disable firewalld.service


关闭其他服务自启动

systemctl disable [服务进程的名字]

四、查询自启动服务

systemctl list-unit-files|grep firewalld.service


查询其他的自启动服务:

systemctl list-unit-files|grep [服务进程的名字]

我们对service和chkconfig两个命令都不陌生,systemctl 是管制服务的主要工具, 它整合了chkconfig 与 service功能于一体。

systemctl is-enabled iptables.service
systemctl is-enabled servicename.service #查询服务是否开机启动
systemctl enable *.service #开机运行服务
systemctl disable *.service #取消开机运行
systemctl start *.service #启动服务
systemctl stop *.service #停止服务
systemctl restart *.service #重启服务
systemctl reload *.service #重新加载服务配置文件
systemctl status *.service #查询服务运行状态
systemctl --failed #显示启动失败的服务

 
 

发布了1997 篇原创文章 · 获赞 507 · 访问量 252万+

猜你喜欢

转载自blog.csdn.net/mp624183768/article/details/103606361