Linux系统操作

编程入门 行业动态 更新时间:2024-10-09 04:22:20

Linux系统<a href=https://www.elefans.com/category/jswz/34/1770947.html style=操作"/>

Linux系统操作

Linux系统操作

  • 1 防火墙操作
    • 1.1 检查防火墙状态
    • 1.2 防火墙配置
    • 1.3 手动开关防火墙
    • 1.3 开放防火墙端口

1 防火墙操作

1.1 检查防火墙状态

firewall-cmd --state

1.2 防火墙配置

  1. linux系统以后开机不需要启动防火墙
systemctl disable firewalld.service
  1. linux系统以后开机需要启动防火墙
systemctl enable firewalld.service

1.3 手动开关防火墙

  1. 关防火墙
systemctl stop firewalld.service
  1. 开防火墙
systemctl start firewalld.service

1.3 开放防火墙端口

  1. 检查防火墙开放的端口
firewall-cmd --list-ports
  1. 检查端口是否开放
firewall-cmd --query-port 80/tcp
  1. 开放防火墙端口
firewall-cmd --zone=public --add-port=80/tcp --permanent
  1. 移除端口
firewall-cmd --zone=public --remove-port=9090/tcp --permanent
  1. 重启防火墙
firewall-cmd --reload

关于防火墙操作的解释

  • zone #作用域
  • add-port=80/tcp #添加端口,格式为:端口/通讯协议
  • remove-port=80/tcp #移除端口,格式为:端口/通讯协议
  • permanent #永久生效,没有此参数重启后失效

更多推荐

Linux系统操作

本文发布于:2024-02-06 12:45:27,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1748983.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:操作   系统   Linux

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!