HowtoForge

Installing Pure-FTPd on Ubuntu 24.04

Pure-FTPd is a free, open-source FTP server software available for Ubuntu and other Linux distributions. Designed with a focus on security, performance, and ease of use, Pure-FTPd offers robust features such as support for virtual users, encrypted connections using TLS/SSL, and various authentication mechanisms. It also provides features like limiting bandwidth, restricting user permissions, and enabling anonymous FTP access. Pure-FTPd is often chosen for its simplicity in configuration compared to other FTP servers, making it a popular choice for both small and large-scale deployments on Ubuntu systems.

The File Transfer Protocol (FTP) is a standard network protocol used to transfer files between a client and a server over a network, such as the internet. Developed in the early 1970s, FTP allows users to upload, download, and manage files on a remote server. It operates using two channels: a command channel for controlling the connection and a data channel for transferring files. FTP can work in either active or passive mode, which dictates how the server and client establish connections. While widely used for file transfers, FTP is considered insecure because data, including login credentials, is transmitted in plain text; I will show you in this guide how to configure Pure-FTPd to use FTPS (FTP over SSL/TLS), making FTP secure.

This tutorial guides you step-by-step through the process of installing and configuring Pure-FTPd on Ubuntu.

Prerequisites for Installing Pure-FTPd

Before proceeding with the installation, ensure you have:

Step-by-Step Installation of Pure-FTPd

Updating System Packages

First, update your system's package list:

sudo apt update

Installing Pure-FTPd

Next, install Pure-FTPd using the following command:

sudo apt install pure-ftpd

Configuring Pure-FTPd for Enhanced Security

Setting Up a Secure Environment

Create a dedicated group for FTP users:

sudo groupadd ftpgroup

Create a user for Pure-FTPd:

sudo useradd -g ftpgroup -d /dev/null -s /etc ftpuser

Managing User Access

To add a user to the FTP server:

sudo pure-pw useradd [username] -u ftpuser -g ftpgroup -d /home/ftpusers/[username]
sudo pure-pw mkdb

Replace [username] with the desired username.

Configuring TLS for Secure Data Transfer

Generate a self-signed certificate:

sudo openssl req -x509 -nodes -days 730 -newkey rsa:2048 -keyout /etc/ssl/private/pure-ftpd.pem -out /etc/ssl/private/pure-ftpd.pem

Modify the Pure-FTPd configuration to activate TLS:

echo 1 | sudo tee /etc/pure-ftpd/conf/TLS
sudo service pure-ftpd restart

Advanced Configuration Options

Here's a list of common settings that can be configured for Pure-FTPd in /etc/pure-ftpd/conf/ directory on Ubuntu. The config file name is in bold.

This list covers the most commonly used configuration options but is not exhaustive. Always refer to the official Pure-FTPd documentation or use the

pure-ftpd-wrapper --help

command for the most accurate and comprehensive information.

Examples

Here is a list of Pure-FTPd settings in /etc/pure-ftpd/conf/ with examples to illustrate the types of values they accept:

These examples should clarify how to configure various options in Pure-FTPd.

Monitoring and Maintenance

Regularly check logs in /var/log/pure-ftpd/ for any unusual activities or errors.

Installing Pure-FTPd on Ubuntu 24.04