# 1. 查看ufw的状态sudo ufw status# 2. 开启ufwsudo ufw enable# 3. 重启防火墙ufwsudo ufw reload# 4. 对外开启80端口sudo ufw allow 80# 对外开启3306端口sudo ufw allow 3306# 再查看开启端口状态sudo ufw status# 启动ufw enable# 默认阻断ufw default deny# 仅指定IP访问端口ufw allow from xx.xx.xx.xx to any port 22
