Ceci est une ancienne révision du document !
Installer les paquetages pré-requis à la compilation de proftpd :
Récupérer l'archive de proftpd sur http://www.proftpd.org
Décompresser l'archive :
cd /root tar xzf proftpd-1.3.2rc4.tar.gz
Installation et compilation de proftpd :
cd /ap01/ftpserver/src/proftpd-1.3.2rc4 ./configure --prefix=/usr/local/proftpd --sysconfdir=/usr/local/proftpd/etc --localstatedir=/ap01/ftpserver/appl/proftpd/var --with-modules=mod_tls:mod_sql:mod_sql_mysql --with-includes=/usr/include/mysql --with-libraries=/usr/lib/mysql make clean make make install
Se positionner dans le répertoire de configuration apache :
cd /usr/local/proftpd/etc
Lancer la commande pour générer la clé privée RSA :
openssl genrsa -out server.key 1024
A partir de notre clé privée nous allons créer notre fichier de demande de signature (Certificate Signing Request) :
openssl req -new -key server.key -out request.csr
Auto-signer la clé et créer le certificat :
openssl x509 -req -days 365 -in request.csr -signkey server.key -out server.crt
Ajouter les lignes suivantes dans le fichier de configuration /usr/local/proftpd/etc/proftpd.conf
:
<IfModule mod_tls.c> TLSEngine on TLSLog /var/ftpd/tls.log # Support both SSLv3 and TLSv1 TLSProtocol SSLv3 TLSv1 # Are clients required to use FTP over TLS when talking to this server? TLSRequired on # Mettre TLSRequired off pour autoriser également les connexions non sécurisées. # Server's certificate TLSRSACertificateFile /usr/local/proftpd/etc/server.crt TLSRSACertificateKeyFile /usr/local/proftpd/etc/server.key # CA the server trusts #TLSCACertificateFile /etc/ftpd/root.cert.pem # Authenticate clients that want to use FTP over TLS? TLSVerifyClient off # Allow SSL/TLS renegotiations when the client requests them, but # do not force the renegotations. Some clients do not support # SSL/TLS renegotiations; when mod_tls forces a renegotiation, these # clients will close the data connection, or there will be a timeout # on an idle data connection. TLSRenegotiate required off </IfModule>
Cette configuration oblige une connexion sécurisée au client.
Lancer la commande suivante pour tester :
openssl s_client -connect 127.0.0.1:21 -starttls ftp