5

Linux常用命令-48:ufw

 2 years ago
source link: https://xugaoxiang.com/2022/06/14/linux-cmds-48-ufw/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

ufw程序用于管理防火墙。相比 iptables,使用起来更加简单,默认需要手动安装 sudo apt install ufw

语法格式:ufw [参数]

常用参数:

b409fcd278930f0d.png
# 启动
ufw enable

# 关闭
ufw disable

# 重启
ufw reload

# 显示防火墙状态及规则
ufw status

# 重置配置
ufw reset

# 允许外部访问80端口
ufw allow 80

# 禁止访问80端口
ufw delete allow 80

# 只允许特定网段访问
ufw allow from 172.21.2.10/24

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK