温馨提示×

Debian vsftp如何启动

小樊
44
2026-07-02 11:38:11
栏目: 智能运维

在 Debian 系统中,vsftpd(Very Secure FTP Daemon)的启动方式取决于你使用的 init 系统。目前 Debian 8 及以后版本默认使用 systemd,但老版本可能使用 SysVinit。下面分别说明。


一、使用 systemd(Debian 8+,推荐)

1️⃣ 安装 vsftpd

sudo apt update
sudo apt install vsftpd

2️⃣ 启动 vsftpd

sudo systemctl start vsftpd

3️⃣ 设置开机自启

sudo systemctl enable vsftpd

4️⃣ 查看运行状态

sudo systemctl status vsftpd

✅ 如果看到 active (running) 说明已成功启动。


5️⃣ 常用 systemd 命令

sudo systemctl stop vsftpd     # 停止
sudo systemctl restart vsftpd  # 重启
sudo systemctl reload vsftpd   # 重载配置(部分配置支持)

二、使用 SysVinit(老版本 Debian)

启动 vsftpd

sudo service vsftpd start

停止 / 重启

sudo service vsftpd stop
sudo service vsftpd restart

开机自启

sudo update-rc.d vsftpd defaults

三、确认 vsftpd 是否正在监听

sudo ss -antp | grep :21

sudo netstat -antp | grep :21

四、常见问题排查

✅ 1. 配置文件位置

/etc/vsftpd.conf

修改配置后需要重启:

sudo systemctl restart vsftpd

✅ 2. 防火墙放行 FTP(如果使用 ufw)

sudo ufw allow 21/tcp

如使用被动模式,还需放行被动端口范围(建议在 vsftpd.conf 中指定)。


✅ 3. 查看日志

sudo tail -f /var/log/vsftpd.log

sudo journalctl -u vsftpd

如果你愿意,可以告诉我:

  • Debian 具体版本(cat /etc/debian_version
  • 本地 / 云服务器
  • 是否需要 被动模式 / 虚拟用户

我可以帮你一步步配置完整的 vsftpd 服务 ✅

0