是的,Debian上的vsftpd(Very Secure FTP Daemon)支持SSL/TLS加密。要在Debian上配置vsftpd以使用SSL加密,您可以按照以下步骤操作:
sudo apt update
sudo apt install vsftpd
您可以使用自签名证书或从CA(证书颁发机构)获取证书。以下是生成自签名证书的命令:
sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/vsftpd.pem -out /etc/ssl/certs/vsftpd.pem
编辑vsftpd的配置文件 /etc/vsftpd.conf,找到并修改以下配置项:
ssl_enable=YES
force_local_data_ssl=YES
force_local_logins_ssl=YES
rsa_cert_file=/etc/ssl/certs/vsftpd.pem
rsa_private_key_file=/etc/ssl/private/vsftpd.pem
应用配置更改并重启vsftpd服务:
sudo systemctl restart vsftpd
确保您的防火墙允许FTP和SSL流量。如果您使用的是ufw,可以运行以下命令:
sudo ufw allow 21/tcp
sudo ufw allow 990/tcp # FTPS数据连接端口
sudo ufw enable
使用支持SSL的FTP客户端(如FileZilla)连接到您的FTP服务器,并确保连接是加密的。您应该能够在连接设置中选择使用SSL/TLS。
请注意,自签名证书在生产环境中不被推荐使用,因为它不会被客户端信任。建议使用由受信任的CA签发的证书。