在 Debian 上配置 FileZilla 服务器的防火墙通常涉及几个步骤。以下是详细的指南:
首先,推荐使用 UFW(Uncomplicated Firewall),这是一个易于使用的防火墙工具。
sudo apt update
sudo apt install ufw
启用 UFW 并设置默认策略为拒绝所有传入连接,允许所有传出连接:
sudo ufw enable
sudo ufw default deny incoming
sudo ufw default allow outgoing
允许必要的端口通过防火墙,例如 SSH(22)、HTTP(80)和 HTTPS(443):
sudo ufw allow ssh
sudo ufw allow http
sudo ufw allow https
你可以允许或拒绝特定 IP 地址的访问:
sudo ufw allow from 192.168.1.100/32
sudo ufw deny from 192.168.1.100/32
要查看当前的防火墙规则和状态,可以运行:
sudo ufw status
安装并配置 FileZilla 服务器,确保在防火墙中开放必要的端口(如 21 用于 FTP,20 和 40000-40009 用于被动模式)。
为了方便故障排除,可以启用 UFW 的日志记录功能:
sudo ufw logging on
通过这些步骤,你可以有效地配置 Debian 上的 FileZilla 服务器防火墙,确保系统安全性和服务的正常运行。