在 Linux 下使用 FileZilla 设置端口,取决于你是连接 FTP 服务器,还是搭建 FTP 服务器。下面分情况说明:
如果你是用 FileZilla 连接别人的 FTP 服务器:
192.168.1.100 或 ftp.example.com212221 或 990✅ 示例:
主机:192.168.1.100
端口:2121
协议:SFTP
⚠️ 注意:
FileZilla Server 官方主要支持 Windows
Linux 上更常用的是vsftpd或proftpd
sudo nano /opt/filezilla-server/etc/FileZilla Server.xml
<Settings> → <Listen> 或 <Port><Port>21</Port>
改成你需要的端口,例如:
<Port>2121</Port>
sudo systemctl restart filezilla-server
sudo ufw allow 2121/tcp
如果你其实想在 Linux 上搭 FTP:
sudo apt install vsftpd
sudo nano /etc/vsftpd.conf
修改:
listen_port=2121
重启:
sudo systemctl restart vsftpd
防火墙:
sudo ufw allow 2121/tcp
FTP 被动模式需要额外端口范围:
vsftpd:
pasv_min_port=30000
pasv_max_port=31000
防火墙:
sudo ufw allow 30000:31000/tcp
| 场景 | 端口位置 |
|---|---|
| 客户端连接 | FileZilla 主界面「端口」 |
| FileZilla Server | 配置文件 Port |
| vsftpd | /etc/vsftpd.conf |
| 被动模式 | PASV 端口范围 |
如果你能告诉我:
我可以给你更精确的步骤。