Linux 开启防火墙 --- FirewallD is not running 问题修复

问题

在配置SSL认证后,需要放开防火墙的443端口,出现了FirewallD is not running错误

java 复制代码
[root@xxx ~]# firewall-cmd --zone=public --add-port=443/tcp --permanent
FirewallD is not running

解决

只需要开启防火墙即可。

【1】先通过systemctl status firewalld命令查看一下防火墙的状态,发现当前是dead状态,即防火墙未开启。

java 复制代码
[root@xxx ~]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
   Active: inactive (dead)
     Docs: man:firewalld(1)

【2】通过systemctl start firewalld命令开启防火墙

java 复制代码
[root@xxx ~]# systemctl start firewalld

【3】 防火墙开启后,再次查看防火墙状态为running即可。

java 复制代码
[root@xxxx ~]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
   Active: active (running) since Mon 2024-02-19 22:40:51 CST; 40s ago
     Docs: man:firewalld(1)
 Main PID: 664 (firewalld)
   CGroup: /system.slice/firewalld.service
           └─664 /usr/bin/python2 -Es /usr/sbin/firewalld --nofork --nopid

【4】再次执行自己命令就会返回success。

java 复制代码
[root@xxx ~]# firewall-cmd --zone=public --add-port=443/tcp --permanent
success

扩展

可以通过systemctl stop firewalld命令关闭防火墙设置

java 复制代码
[root@xxx ~]# systemctl stop firewalld
相关推荐
程序员海军3 小时前
用了两年多 GPT,我最近开始换模型了,还折腾了个求职避坑 Agent
前端·人工智能·后端
码士集团小青3 小时前
SpringBoot 集成缓存性能之王 Caffeine
spring boot·后端·缓存
怕浪猫3 小时前
红利窗口开着,程序员别在场边囤课
面试·github·ai编程
程序员-Benothing3 小时前
Linux安全加固指南:账号、权限、服务、审计基线
linux·运维·安全
Mininglamp_27183 小时前
接口调用 vs 屏幕理解:两种 GUI 自动化架构的技术取舍
运维·架构·自动化
Cry丶4 小时前
ubuntu安装vsftpd
服务器·网络·ubuntu
凤凰院凶涛QAQ4 小时前
《Java版数据结构 & 集合类剖析》Map & Set & 反射:“从哈希碰撞到红黑树转换,反射帮你扒开 HashMap 的桶数组看个究竟”
java·数据结构·算法
H.莓飛4 小时前
【数据结构】排序_OJ题(一):计数、桶与排序后的处理
java·开发语言·数据结构
wangchunyu1145 小时前
JAVA AQS与Lock实现原理(含CAS)
java·开发语言·word
excel5 小时前
IndexNow:让搜索引擎更快发现网站更新的主动通知协议
前端·后端·架构