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。