centos 安装防火墙,并开启对应端口号

1.查看防火墙状态:

命令:systemctl status firewalld.service

开启防火墙时,提示没有安装防火墙

bash 复制代码
[root@localhost ~]# systemctl start firewalld.service
Failed to start firewalld.service: Unit not found.

2.安装防火墙

bash 复制代码
[root@localhost ~]# yum install firewalld

2.开启防火墙

bash 复制代码
[root@localhost ~]# systemctl start firewalld.service

3.开启端口

bash 复制代码
[root@localhost ~]# firewall-cmd --add-port=5889/tcp --permanent
success

4.重启防火墙

bash 复制代码
[root@localhost ~]# firewall-cmd --reload
success

5.查看开启端口号

bash 复制代码
[root@localhost ~]# firewall-cmd --list-ports
5889/tcp
相关推荐
xuxie99几秒前
N22 key驱动
linux·运维·服务器
c++逐梦人8 分钟前
Linux多线程
linux·服务器
WangJunXiang612 分钟前
LVS 负载均衡群集
运维·负载均衡·lvs
开心码农1号13 分钟前
RabbitMQ 生产运维命令大全
linux·开发语言·ruby
百结21414 分钟前
LVS 负载均衡群集
运维·负载均衡·lvs
IMPYLH14 分钟前
Linux 的 nl 命令
linux·运维·服务器·bash
卤炖阑尾炎15 分钟前
从原理到实战:LVS 负载均衡集群全解析(OpenEuler 环境)
运维·负载均衡·lvs
咖喱o21 分钟前
路由策略
linux·服务器·网络
南境十里·墨染春水26 分钟前
linux学习进展 主函数的参数
linux·运维·学习
淮北49426 分钟前
obsidian管理自己的计划
linux·学习·kanban·obsidian