Sweshi's Tutorials

Making a Secure ProFTPD (FTP Server) in Centos 9 Linux

Recompiling proftpd with openssl

NB: This tutorial assumes that you have already installed proftpd on your system. If you have not Click on this link on how to do so

roFTPD (Pro FTP Daemon) is an FTP (File Transfer Protocol) server for Unix-like operating systems. It serves as a software solution to enable file transfers between computers over a network, typically the internet.

sftp server part 6: yum install openssl-devel -y

Navigate to the directory where you extracted the proftpd archive. For me, this was “/root/Downloads/proftpd-1.3.8a/”.

sftp server part 7:Navigate to the extracted proftpd sources

sftp server part 8:Run the configuration script

Run the configuration script that checks for the kernel, compiler and other requirements. I have used the command

./configure --enable-shadow --enable-autoshadow --enable-openssl --with-openssl-cmdline=/usr/bin/openssl --with-modules=mod_tls.

This time the configuration script is made to enable the use of open ssl and includes the tls module.

sftp server part 9:compile the proftpd daemon with openssl module

Compile the proftpd daemon using the “make” command.

sftp server part 10: install the compiled proftpd daemon

Install the proftpd daemon using the “make install” command.

sftp server part 11: configure the proftpd.conf IfModule_tls

Open the proftpd.conf using the command “vim /usr/local/etc/proftpd.conf”.

sftp server part 12:Changing the IfModule_tls section

Add the IfModule section in the “proftpd.conf”. Some of the key options include;

TLSEngine on

This directive turns on the TLS (Transport Layer Security) engine, enabling SSL/TLS support for ProFTPD. When TLSEngine is set to "on," ProFTPD will attempt to negotiate secure connections using SSL/TLS.

TLSLog /var/log/proftpd/tls.log

This directive specifies the path to the log file where TLS-related log messages will be written. It's helpful for troubleshooting and monitoring SSL/TLS connections.

TLSProtocol SSLv3

This directive specifies the TLS protocol version to be used. In this example, it's set to SSLv3. You can adjust the protocol version based on your security requirements and compatibility with clients.

TLSRSACertificateFile /usr/local/etc/ssl/ftp.cert.pem

This directive specifies the path to the RSA certificate file used for the SSL/TLS connection. The certificate file contains the public key and other information about the server. Replace /path/to/ftp.cert.pem with the actual path to your SSL/TLS certificate file.

TLSRSACertificateKeyFile /usr/local/etc/ssl/ftp.key.pem

This directive specifies the path to the RSA private key file associated with the certificate. The private key is used for decrypting incoming secure connections. Replace /path/to/ftp.key.pem with the actual path to your private key file.