在 Linux 下使用 FileZilla(无论是作为客户端还是服务端),“设置端口”分几种常见情况。下面按最常见场景说明:
ftp.example.com21sftp.example.com2121
:端口旧版 FileZilla Server 主要支持 Windows,Linux 新版已支持。
/etc/filezilla-server/
编辑配置文件(示例):
sudo nano /etc/filezilla-server/FileZilla Server.xml
找到:
<Listen port="21" />
改为:
<Listen port="2121" />
sudo systemctl restart filezilla-server
sudo ufw allow 21/tcp
sudo ufw allow 2121/tcp
sudo firewall-cmd --add-port=2121/tcp --permanent
sudo firewall-cmd --reload
FTP 被动模式还需开放一段端口:
<Passive portrange="50000-51000" />
防火墙也要放行:
sudo ufw allow 50000:51000/tcp
✅ 连不上?
ss -tunlp | grep 21
如果你能说明:
我可以给你更精确的步骤。