确保客户端设备已正常联网,且网络连接稳定。可通过ping命令测试与服务器的连通性(如ping 服务器IP地址),若无法ping通,需排查本地网络(如重启路由器、切换Wi-Fi/有线连接)或联系网络管理员。
sudo systemctl status vsftpd,若服务未运行,用sudo systemctl start vsftpd启动;若未安装,用sudo apt-get install vsftpd安装。sudo systemctl status ssh,未运行则用sudo systemctl start ssh启动,未安装则用sudo apt-get install openssh-server安装。active (running)状态。Ubuntu常用ufw(Uncomplicated Firewall)管理防火墙,需开放对应端口:
sudo ufw allow 21/tcpsudo ufw allow 22/tcp/etc/vsftpd.conf,设置pasv_min_port=60000、pasv_max_port=60020,然后执行sudo ufw allow 60000:60020/tcp。sudo ufw enable,并检查规则:sudo ufw status。编辑→设置→常规,找到“连接超时(秒)”,将默认的20秒调整为更大的值(如300秒,即5分钟),避免因网络延迟导致超时。编辑→设置→传输→`被动模式设置,勾选“使用被动模式连接”。若服务器位于内网,还需勾选“服务器使用PASV”并填写服务器的公网IP地址(需服务器管理员提供)。/etc/vsftpd.conf,确保以下关键设置正确:anonymous_enable=NO    # 禁止匿名登录
local_enable=YES       # 允许本地用户登录
write_enable=YES       # 允许上传文件
chroot_local_user=YES  # 限制用户在自己的家目录
allow_writeable_chroot=YES  # 允许家目录可写(避免权限问题)
修改后重启vsftpd:sudo systemctl restart vsftpd。/etc/ssh/sshd_config,确保Port 22未被注释(若有修改端口号,需同步更新FileZilla中的端口设置),并重启SSH服务:sudo systemctl restart ssh。FTP协议有主动(Active)和被动(Passive)两种模式:
FileZilla的日志文件记录了连接过程的详细信息,可通过日志排查问题根源:
查看→消息日志,查看“错误”或“警告”级别的日志(如“连接超时”“无法解析主机名”“拒绝连接”)。/var/log/vsftpd.log或/var/log/auth.log)也可提供更多信息(需服务器管理员协助查看)。若以上方法均无效,可能是FileZilla版本过旧或安装损坏:
sudo apt-get remove filezillasudo apt-get update && sudo apt-get install filezilla