521源码-免费网络教程-Linux如何增加安全组端口(命令行方式)

更多网站源码学习教程,请点击👉-521源码-👈获取最新资源

使用命令行方式增加Linux的安全组端口

我们这里以 Centos7.x 为例

firewalld 常用命令

服务的名称是 firewalld

#查看firewall防火墙状态

systemctl status firewalld

等价命令

service firewalld status

#开启firewall防火墙

systemctl start firewalld.service

等价命令

service firewalld start

#关闭firewall防火墙

systemctl stop firewalld.service

等价命令

service firewalld stop

#禁止firewall开机启动,此操作尽量不要用

systemctl disable firewalld.service

操作命令是 firewall-cmd

复制代码
firewall-cmd --list-ports
#查看firewall防火墙开放端口
 
firewall -cmd --reload
#重新加载防火墙permanent(永久的)的规则配置,覆盖当前运行时配置,在运行时添加的非permanent规则,都将丢失
 
#开放firewall防火墙端口,需重启防火墙生效service firewalld restart
firewall-cmd --zone=public --add-port=8088/tcp --permanent
# 移除指定端口
firewall-cmd --permanent --remove-port=8088/tcp

命令参数命令含义:

复制代码
-zone #作用域
-add-port=80/tcp #添加端口,格式为:端口 / 通讯协议
-permanent #永久生效,没有此参数重启后失效
相关推荐
心中有国也有家1 分钟前
AtomGit Flutter 鸿蒙客户端:MoodStorage 的 CRUD 集成验证
android·服务器·flutter·华为·harmonyos
进击的荆棘17 分钟前
Linux——基础指令(中)
linux·服务器·linux基础指令
b1305381004931 分钟前
鸿蒙应用开发实战【41】— 登录页面LoginPage完整开发
服务器·华为·harmonyos·鸿蒙系统
zt1985q38 分钟前
本地部署开源轻量级监控平台 Beszel 并实现外部访问
运维·服务器·网络协议·开源
L-影42 分钟前
Server-Sent Events (SSE):让服务器“主动开口”的实时推送技术
运维·服务器·sse
不能跑的代码不是好代码9 小时前
Linux系统常用命令中文速查表
linux·运维·服务器
石一峰69910 小时前
深入理解 Linux 中断三层机制与 1-Wire 时序锁原理
linux·运维·服务器
无限码农11 小时前
Linux上通过cmake编译uchardet
linux·运维·服务器
灯琰112 小时前
STM32F4+W5500 移植与开发常见问题
网络
运维大师12 小时前
【Linux运维极简教程】06-网络配置与管理
linux·运维