在Ubuntu中启用VSFTPD的SSL,你需要按照以下步骤操作:
sudo apt-get update
sudo apt-get install vsftpd
sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/vsftpd.pem -out /etc/ssl/certs/vsftpd.pem
在执行此命令时,系统会提示你输入一些信息,如国家、组织名称等。这些信息将包含在证书中。
sudo cp /etc/vsftpd.conf /etc/vsftpd.conf.backup
sudo nano /etc/vsftpd.conf
# 将这些行添加到文件中或修改它们
ssl_enable=YES
allow_anon_ssl=NO
force_local_data_ssl=YES
force_local_logins_ssl=YES
ssl_tlsv1=YES
ssl_sslv2=NO
ssl_sslv3=NO
rsa_cert_file=/etc/ssl/certs/vsftpd.pem
rsa_private_key_file=/etc/ssl/private/vsftpd.pem
这些设置将启用SSL并强制使用TLSv1,同时禁用不安全的SSLv2和SSLv3协议。
保存并关闭配置文件。
重启VSFTPD服务以应用更改:
sudo systemctl restart vsftpd
sudo ufw allow 21/tcp
sudo ufw allow 990/tcp # 如果你使用FTPS的隐式模式
sudo ufw reload
现在,你的VSFTPD服务器应该已经启用了SSL。客户端在连接时需要使用FTPS(通常在端口990上)并验证服务器的证书。