ProftpdConfDir="/etc/proftpd/ssl"
ProftpdConfig="/etc/proftpd/proftpd.conf"
ProftpdTLSConfig="/etc/proftpd/conf.d/proftpd-tls.conf"
mkdir ${ProftpdConfDir}
# Генерируем ключи
openssl req -new -x509 -days 3650 -nodes -out ${ProftpdConfDir}/proftpd.cert.pem -keyout ${ProftpdConfDir}/proftpd.key.pem
cp ${ProftpdConfig} ${ProftpdConfig}_$(date '+%Y%m%d%H%M%S').backup
echo "Include ${ProftpdTLSConfig}" >> ${ProftpdConfig}
#cp ${ProftpdTLSConfig} ${ProftpdTLSConfig}_$(date '+%Y%m%d%H%M%S').backup
echo "
LoadModule mod_ctrls_admin.c
LoadModule mod_tls.c
<IfModule mod_tls.c>
TLSEngine on
TLSLog /var/log/proftpd/tls.log
TLSProtocol TLSv1.2
TLSCipherSuite AES128+EECDH:AES128+EDH
TLSOptions NoCertRequest AllowClientRenegotiations NoSessionReuseRequired
TLSRSACertificateFile ${ProftpdConfDir}/proftpd.cert.pem
TLSRSACertificateKeyFile ${ProftpdConfDir}/proftpd.key.pem
TLSVerifyClient off
TLSRequired on
RequireValidShell no
</IfModule>
" > ${ProftpdTLSConfig}
service proftpd restart