Linux CenOS 7 防火墙 端口 systemctl 操作项

Posted lszw

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Linux CenOS 7 防火墙 端口 systemctl 操作项相关的知识,希望对你有一定的参考价值。

 

Centos开放端口

# firewall-cmd --zone=public --add-port=3306/tcp --permanent

Centos关闭端口 
# firewall-cmd --zone=public --remove-port=8090/tcp --permanent

使配置生效
# firewall-cmd --reload

 

systemctl 操作项(启动、停电、状态) 服务名

启用服务 systemctl start 服务名
停止服务 systemctl stop 服务名
查看服务状态 systemctl status 服务名
服务开机启动 systemctl enable 服务名
禁用服务 systemctl disable 服务名

服务所在的目录 /usr/lib/systemd/system/

以上是关于Linux CenOS 7 防火墙 端口 systemctl 操作项的主要内容,如果未能解决你的问题,请参考以下文章