1.UFW(简单防火墙)
Ubuntu默认的防火墙配置工具是ufw防火墙。
1.1. 检查防火墙状态
A。要检查 UFW 的状态,请使用以下命令:
sudo ufw status
输出示例:
Status: active
或者
Status: inactive
如果输出显示“状态:活动”,则防火墙已打开。如果显示“Status: inactive”,则说明防火墙已关闭。
1.2. 检查特定端口
A。要检查所有打开的端口以及与 UFW 相关的信息,请使用以下命令:
sudo ufw status verbose
Status: active
Logging: on (low)
Default: deny (incoming), allow (outgoing), disabled (routed)
New profiles