From f0531d6fb7681e94747e3c6435a0ef575960efe7 Mon Sep 17 00:00:00 2001 From: Christoph Date: Mon, 25 Dec 2017 01:27:16 +0100 Subject: [PATCH] Add creation of certificate and DH parameters file. --- install_pure-ftpd.sh | 42 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/install_pure-ftpd.sh b/install_pure-ftpd.sh index 90d1a0a..e77ffab 100755 --- a/install_pure-ftpd.sh +++ b/install_pure-ftpd.sh @@ -239,7 +239,7 @@ fi echononl " Create initial passwd database (pureftpd.pdb)" if [[ ! -f /etc/pure-ftpd/pureftpd.pdb ]]; then - touch /etc/pure-ftpd/pureftpd.pdb + touch /etc/pure-ftpd/pureftpd.pdb > $tmp_err_msg 2>&1 if [[ $? -eq 0 ]] ; then echo_ok else @@ -250,6 +250,46 @@ else echo_skipped fi +subj=" +C=DE +ST=Berlin +localityName=Berlin +O=O.OPEN +organizationalUnitName=Network Services +commonName=$(hostname -f) +emailAddress=argus@oopen.de +" + +subj=" +C=DE +ST=Berlin +localityName=Berlin +O=O.OPEN +organizationalUnitName=Network Services +commonName=$(hostname -f) +emailAddress=argus@oopen.de +" +echononl " Create certificate 'pure-ftpd.pem'.." +openssl req -batch -x509 -nodes -days 7304 -newkey rsa:2048 \ + -subj "$(echo -n "$subj" | tr "\n" "/")" \ + -keyout /etc/ssl/private/pure-ftpd.pem \ + -out /etc/ssl/private/pure-ftpd.pem > $tmp_err_msg 2>&1 +if [[ $? -eq 0 ]] ; then + echo_ok +else + echo_failed + error "$(cat $tmp_err_msg)" +fi + +echononl " DH parameters file 'pure-ftpd-dhparams.pem'" +openssl dhparam -out /etc/ssl/private/pure-ftpd-dhparams.pem 2048 > $tmp_err_msg 2>&1 +if [[ $? -eq 0 ]] ; then + echo_ok +else + echo_failed + error "$(cat $tmp_err_msg)" +fi + # - Configure syslogd matching the configuration od amavisd # - echononl " Configure syslogd matching the ftp syslog facility"