Linux FTP服務器常用數據加密方法有兩種,具體如下:
FTPS(FTP over SSL/TLS)
sudo apt-get install vsftpd(Debian)或sudo yum install vsftpd(RPM)。sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/vsftpd.pem -out /etc/ssl/private/vsftpd.pem。/etc/vsftpd.conf,啟用SSL并指定證書路徑:ssl_enable=YES
rsa_cert_file=/etc/ssl/private/vsftpd.pem
rsa_private_key_file=/etc/ssl/private/vsftpd.pem
force_local_data_ssl=YES
force_local_logins_ssl=YES
```。
sudo systemctl restart vsftpd。SFTP(SSH File Transfer Protocol)
sudo apt-get install openssh-server(Debian)或sudo yum install openssh-server(RPM)。/etc/ssh/sshd_config,確保啟用SFTP:Subsystem sftp /usr/lib/openssh/sftp-server
```。
sudo systemctl restart ssh(Debian)或sudo systemctl restart sshd(RPM)。ssh username@hostname或FileZilla的SFTP模式)。選擇建議:優先使用SFTP,安全性更高且配置更簡便;若需兼容傳統FTP客戶端,可選擇FTPS。