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 #永久生效,没有此参数重启后失效
相关推荐
2401_892070981 天前
【Linux C++ 日志系统实战】LogFile 日志文件管理核心:滚动策略、线程安全与方法全解析
linux·c++·日志系统·日志滚动
lwx9148521 天前
Linux-Shell算术运算
linux·运维·服务器
somi71 天前
ARM-驱动-02-Linux 内核开发环境搭建与编译
linux·运维·arm开发
双份浓缩馥芮白1 天前
【Docker】Linux 迁移 docker 目录(软链接)
linux·docker
为何创造硅基生物1 天前
ESP32S3的RGB屏幕漂移问题
网络
好运的阿财1 天前
process 工具与子agent管理机制详解
网络·人工智能·python·程序人生·ai编程
黄昏晓x1 天前
Linux ---- UDP和TCP
linux·tcp/ip·udp
路溪非溪1 天前
Linux驱动开发中的常用接口总结(一)
linux·运维·驱动开发
此刻觐神1 天前
IMX6ULL开发板学习-01(Linux文件目录和目录相关命令)
linux·服务器·学习
2401_892070981 天前
【Linux C++ 日志系统实战】高性能文件写入 AppendFile 核心方法解析
linux·c++·日志系统·文件写对象