Debian FTPServer支持SSL加密,常見的FTP服務器軟件(如ProFTPd、vsftpd)均可以通過配置實現SSL/TLS加密,確保FTP數據傳輸的安全性。
Debian系統中,ProFTPd和vsftpd是兩款主流的FTP服務器軟件,均原生支持SSL/TLS加密功能,可通過配置啟用。
ProFTPd通過mod_tls模塊實現SSL支持,具體步驟如下:
sudo apt-get install proftpd openssl安裝ProFTPd和OpenSSL。/etc/proftpd/proftpd.conf,關閉IPv6(可選)、禁用Ident查詢,添加DefaultRoot ~限制用戶訪問家目錄。/etc/proftpd/ssl目錄,運行openssl req -new -x509 -days 365 -nodes -out /etc/proftpd/ssl/proftpd.cert.pem -keyout /etc/proftpd/ssl/proftpd.key.pem生成自簽名證書(有效期365天)。proftpd.conf中添加<IfModule mod_tls.c>段落,設置TLSEngine on(開啟TLS)、TLSRSACertificateFile(證書路徑)、TLSRSACertificateKeyFile(私鑰路徑)、TLSRequired on(強制使用TLS)等參數。sudo systemctl restart proftpd應用配置。vsftpd(Very Secure FTP Daemon)以安全性著稱,配置SSL的步驟如下:
sudo apt update && sudo apt install vsftpd ssl-cert安裝vsftpd及ssl-cert(用于生成自簽名證書)。sudo dpkg-reconfigure ssl-cert重新配置ssl-cert,自動生成證書(路徑:/etc/ssl/certs/ssl-cert-snakeoil.pem)和私鑰(路徑:/etc/ssl/private/ssl-cert-snakeoil.key);或使用openssl手動創建(命令參考ProFTPd部分)。/etc/vsftpd.conf,啟用SSL(ssl_enable=YES)、強制數據/登錄加密(force_local_data_ssl=YES、force_local_logins_ssl=YES)、禁用舊版協議(ssl_sslv2=NO、ssl_sslv3=NO)、指定證書路徑(rsa_cert_file、rsa_private_key_file)。sudo systemctl restart vsftpd使配置生效。