在 Debian 系统下,启动 vsftpd(Very Secure FTP Daemon) 通常按以下步骤操作。
sudo apt update
sudo apt install vsftpd
sudo systemctl start vsftpd
sudo systemctl enable vsftpd
sudo systemctl status vsftpd
正常输出中应包含 active (running)。
sudo systemctl restart vsftpd # 重启
sudo systemctl stop vsftpd # 停止
vsftpd 的主配置文件路径:
/etc/vsftpd.conf
常见检查项:
sudo nano /etc/vsftpd.conf
建议确认以下配置:
listen=YES
anonymous_enable=NO
local_enable=YES
write_enable=YES
修改配置后需要重启服务:
sudo systemctl restart vsftpd
FTP 默认使用 21 端口:
sudo ufw allow 21/tcp
如果启用被动模式(推荐),还需放行被动端口范围,例如:
pasv_min_port=30000
pasv_max_port=31000
sudo ufw allow 30000:31000/tcp
查看端口监听:
ss -antp | grep 21
或
netstat -antp | grep 21
查看日志:
sudo journalctl -u vsftpd
或
cat /var/log/syslog | grep vsftpd
如果你需要 被动模式配置 / 虚拟用户 / 限制用户目录(chroot),可以继续告诉我你的使用场景,我可以给你一份完整可用的 vsftpd.conf 示例。