第3步:配置Pure-FTPD以使用SSL/TLS
强制pure-ftpd通过TLS进行通信:
echo "2" > /etc/pure-ftpd/conf/TLS
第2步:创建一个自签名的SSL/TLS证书
为服务器生成自签名的SSL/TLS证书。
该命令在/etc/ssl/privatial目录中创建服务器密钥和证书文件并存储。
sudo openssl req -x509 -nodes -newkey rsa:2048 -keyout /etc/ssl/private/pure-ftpd.pem -out /etc/ssl/private/pure-ftpd.pem -days 365
运行上面的命令后,系统会提示我们回答证书的几个问题。
Generating a 2048 bit RSA private key . . . . . . . . . . . . . ..+++ .+++ writing new private key to '/etc/ssl/private/pure-ftpd.pem' ---- You are about to be asked to enter information that will be incorporated into your certificate request. What you are about to enter is what is called a Distinguished Name or a DN. There are quite a few fields but you can leave some blank For some fields there will be a default value, If you enter '.', the field will be left blank. ---- Country Name (2 letter code) [AU]:US State or Province Name (full name) [Some-State]:New York Locality Name (eg, city) []:Brooklyn Organization Name (eg, company) [Internet Widgits Pty Ltd]:Website for Students Organizational Unit Name (eg, section) []:SSL Unit Common Name (e.g. server FQDN or YOUR name) []:example.com Email Address []:webmaster@example.com
第3步:重新启动Pure-FTPD服务器
重新启动Pure-FTPD服务:
sudo systemctl restart pure-ftpd
现在在FTP客户端(FileZilla)上创建一个新站点,并使用与TLS的显式FTP加密的FTP协议。
输入用户名和密码并连接。
我们现在就可以通过SSL/TLS安全地传输文件了。
第1步:在Ubuntu 18.04 LTS上安装Pure-FTPD
要在Ubuntu上安装Pure-FTPD,请运行以下命令。
sudo apt update sudo apt-get install pure-ftpd
安装Pure-FTPD后,下面的命令可用于停止,启动和启用pure-ftpd服务(启用服务:在服务器开机引导时自动启动服务)
sudo systemctl stop pure-ftpd.service sudo systemctl start pure-ftpd.service sudo systemctl enable pure-ftpd.service
日期:2020-07-07 20:55:47 来源:oir作者:oir