在 Debian 上选择 FTPServer(FTP over SSL/TLS),主要取决于你的使用场景(是否要兼容传统 FTP、是否要虚拟用户、权限管理复杂度、性能需求等)。下面给你一个实用选型指南 + 推荐方案。
| FTP Server | 是否支持 FTPS | 特点 | 推荐场景 |
|---|---|---|---|
| vsftpd | ✅ 支持(显式/隐式) | 轻量、稳定、安全、配置简单 | 最推荐,Debian 官方首选 |
| ProFTPD | ✅ 支持 | 功能丰富、模块化、接近 Apache 风格 | 复杂权限、虚拟用户 |
| Pure-FTPd | ✅ 支持 | 配置简单、安全、支持多种认证 | 中小型环境 |
| SFTP(OpenSSH) | ❌(不是 FTP) | 基于 SSH,更安全 | 如果可以不用 FTP,强烈推荐 |
⚠️ 注意:
FTPS ≠ SFTP
- FTPS:FTP + SSL/TLS
- SFTP:SSH 文件传输(不是 FTP)
sudo apt update
sudo apt install vsftpd openssl
sudo openssl req -x509 -nodes -days 365 \
-newkey rsa:2048 \
-keyout /etc/ssl/private/vsftpd.key \
-out /etc/ssl/certs/vsftpd.crt
编辑 /etc/vsftpd.conf:
listen=YES
listen_ipv6=NO
anonymous_enable=NO
local_enable=YES
write_enable=YES
chroot_local_user=YES
allow_writeable_chroot=YES
ssl_enable=YES
rsa_cert_file=/etc/ssl/certs/vsftpd.crt
rsa_private_key_file=/etc/ssl/private/vsftpd.key
force_local_data_ssl=YES
force_local_logins_ssl=YES
pasv_min_port=30000
pasv_max_port=31000
sudo systemctl restart vsftpd
✅ 支持 显式 FTPS(推荐)
✅ 客户端如 FileZilla 选择 “使用显式 FTP over TLS”
sudo apt install proftpd openssl
sudo apt install proftpd-mod-crypto
配置 /etc/proftpd/modules.conf:
LoadModule mod_tls.c
在 /etc/proftpd/proftpd.conf 中加入:
<IfModule mod_tls.c>
TLSEngine on
TLSLog /var/log/proftpd/tls.log
TLSProtocol TLSv1.2
TLSRSACertificateFile /etc/ssl/certs/vsftpd.crt
TLSRSACertificateKeyFile /etc/ssl/private/vsftpd.key
TLSRequired on
</IfModule>
sudo apt install pure-ftpd
启用 TLS:
sudo apt install pure-ftpd-common
sudo echo 2 > /etc/pure-ftpd/conf/TLS
证书路径:
/etc/ssl/private/pure-ftpd.pem
sftp user@server_ip
如果你只是“文件传输”,SFTP 是更好的选择。
| 场景 | 推荐 |
|---|---|
| 传统 FTP + 加密 | ✅ vsftpd |
| 复杂权限 / 虚拟用户 | ✅ ProFTPD |
| 简单安全 | ✅ SFTP(OpenSSH) |
| 新项目 | ❌ 不建议用 FTP |
如果你愿意,可以告诉我:
我可以帮你 直接给一套完整可用配置 ✅