FileZilla 连不上 Debian 一般不是单一原因,可以按下面顺序一步步排查(从最常见到较少见)。我先给你一个快速检查清单,再展开每一步怎么做。
在 Debian 上执行:
ip a
sudo systemctl status ssh
sudo ss -lntp | grep :22
重点看:
ssh 服务是否 active (running)如果这三项有问题,FileZilla 一定连不上。
Debian 默认可能没装或没启动 SSH。
sudo apt update
sudo apt install openssh-server
sudo systemctl enable ssh
sudo systemctl start ssh
Debian 默认可能用 ufw 或 nftables。
sudo ufw status
sudo ufw allow 22
sudo ufw reload
sudo iptables -L -n
如果看到 DROP / REJECT 22,需要放行。
FileZilla 不是 FTP,而是 SFTP。
在 FileZilla 中:
❌ 不要选 FTP
❌ 不要填 21 端口
如果你用 VirtualBox / VMware:
设置 → 网络 → 高级 → 端口转发
主机端口:2222
子系统端口:22
FileZilla 连接:
主机:127.0.0.1
端口:2222
如果你用 root 登录失败:
sudo nano /etc/ssh/sshd_config
确认:
PermitRootLogin yes
PasswordAuthentication yes
然后:
sudo systemctl restart ssh
⚠ 生产环境不建议 root 直接登录
passwd 用户名
| FileZilla 提示 | 原因 |
|---|---|
| 连接超时 | IP 不通 / 防火墙 |
| 无法连接到服务器 | SSH 没开 |
| 认证失败 | 用户名/密码错 |
| 服务器返回错误 | 协议选错 |
| ECONNREFUSED | Debian 没监听 22 |
ping 你的DebianIP
ssh 用户名@DebianIP
如果 ssh 能连,FileZilla 一定能连。
你可以直接把下面信息发我(不用全发,发一部分也行):
ip a
sudo systemctl status ssh
我可以一步一步帮你精确到“哪一行配置错了”。