在 Debian 上搭建 FTP 服务器时,“限速”通常指限制用户上传/下载速度。常见 FTP 服务端有 vsftpd、ProFTPD、Pure-FTPd,下面分别说明。
sudo apt update
sudo apt install vsftpd
编辑配置文件:
sudo nano /etc/vsftpd.conf
添加或修改以下参数(单位是 bytes/sec):
# 匿名用户限速
anon_max_rate=50000
# 本地用户限速
local_max_rate=100000
示例:
50000 ≈ 50 KB/s100000 ≈ 100 KB/ssudo systemctl restart vsftpd
✅ 特点:
sudo apt install proftpd
编辑:
sudo nano /etc/proftpd/proftpd.conf
TransferRate RETR 100.0
TransferRate STOR 80.0
单位:KB/s
<Limit RATE>
UserLimit RATE 50.0 user1
UserLimit RATE 30.0 user2
</Limit>
sudo systemctl restart proftpd
✅ 适合多用户场景
sudo apt install pure-ftpd
sudo pure-pw usermod ftpuser -t 100 -T 50
-t:下载限速(100 KB/s)-T:上传限速(50 KB/s)sudo pure-pw mkdb
✅ 最适合虚拟用户
如使用 tc 或 wondershaper 限制整台服务器带宽(不区分协议):
sudo apt install wondershaper
sudo wondershaper eth0 1000 500
| 需求 | 推荐 |
|---|---|
| 简单、稳定 | vsftpd |
| 多用户不同限速 | ProFTPD / Pure-FTPd |
| 虚拟用户 | Pure-FTPd |
如果你能告诉我:
我可以给你精确配置示例。