Kolonel Server
Install ProFTPD with TLS on AlmaLinux

What Is ProFTPD?

ProFTPD (Professional FTP Daemon) is an open-source FTP server designed to provide a secure, flexibele, and highly configurable file transfer platform for Linux environments.

Its configuration syntax is similar to the Apache HTTP Server, making it familiar to many system administrators. ProFTPD supports a wide range of advanced features, inbegrepen:

  • Virtual FTP servers
  • Anonymous FTP access
  • User and group-based permissions
  • TLS/SSL encryption
  • LDAP authentication
  • IPv6 support
  • Flexible access controls

When combined with TLS encryption, ProFTPD can securely transfer files while protecting usernames, wachtwoorden, and data from interception.

Why Use TLS with ProFTPD?

Traditional FTP transmits credentials and data in plain text.

This means attackers monitoring network traffic may be able to view:

  • Usernames
  • Passwords
  • File contents

Beveiliging van transportlaag (TLS) encrypts communication between the FTP client and server, significantly improving security.

Wordpress Hosting

WordPress-webhosting

Vanaf $ 3,99/maandelijks

Koop nu

Voordelen zijn onder meer:

  • Encrypted authentication
  • Secure file transfers
  • Protection against credential theft
  • Improved compliance with security standards

Voor productieomgevingen, TLS should always be enabled.

Vereisten

Before beginning the installation, ensure you have:

Besturingssysteem

  • AlmaLinux 8

Access Requirements

  • Root access or sudo privileges
  • Internet connectivity

Required Components

  • Firewalld (aanbevolen)
  • SELinux enabled or configured appropriately

Stap 1: Install the EPEL Repository

ProFTPD packages are not included in the default AlmaLinux repositories.

Install the Extra Packages for Enterprise Linux (EPEL) repository:

sudo yum install -y epel-release

Stap 2: Import the EPEL GPG Key

Import the repository signing key:

Cheap VPS

Goedkope VPS-server

Vanaf $ 2,99/maandelijks

Koop nu
sudo rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-8

This allows package verification during installation.

Stap 3: Update the System

Before installing new software, update existing packages:

sudo yum update -y

Keeping the operating system updated helps avoid dependency and compatibility issues.

Stap 4: Install ProFTPD and OpenSSL

Install ProFTPD along with OpenSSL and supporting utilities:

sudo yum install -y proftpd openssl proftpd-utils

After installation completes, start the service:

sudo systemctl start proftpd

Enable automatic startup:

Windows VPS

Windows VPS-hosting

Remote Access & Full Admin

Koop nu
sudo systemctl enable proftpd

Verify service status:

sudo systemctl status proftpd

The service should report an active running state.

Stap 5: Open FTP Port in the Firewall

Allow incoming FTP connections on port 21.

sudo firewall-cmd --add-port=21/tcp --permanent

Reload the firewall configuration:

sudo firewall-cmd --reload

Verify the rule:

sudo firewall-cmd --list-ports

Voorbeelduitvoer:

21/tcp

Stap 6: Verify the Installed Version

Confirm that ProFTPD is installed correctly.

proftpd -v

Voorbeelduitvoer:

ProFTPD Version 1.3.6e

The displayed version may differ depending on the repository version available at installation time.

Stap 7: Create FTP Users

For security purposes, create dedicated users and groups for FTP access.

Create a Group

sudo groupadd proftpdgroup

Create a User

sudo useradd -G proftpdgroup ftpuser -s /sbin/nologin -d /ftpshare

Set a password:

sudo passwd ftpuser

Set Directory Permissions

sudo chmod -R 1750 /ftpshare

This restricts access while allowing authorized users to access their files.

Example configuration:

Group: proftpdgroup
User: ftpuser
Home Directory: /ftpshare

Stap 8: Enable TLS Encryption

Before modifying the configuration, create a backup:

sudo cp /etc/proftpd.conf /etc/proftpd.conf.backup

Edit the ProFTPD configuration file:

sudo nano /etc/proftpd.conf

Add the following TLS configuration:

TLSEngine                    on
TLSRequired                  on
TLSRSACertificateFile        /etc/pki/tls/certs/proftpd.pem
TLSRSACertificateKeyFile     /etc/pki/tls/certs/proftpd.pem
TLSCipherSuite               ALL:!ADH:!DES
TLSOptions                   NoCertRequest
TLSVerifyClient              off
TLSRenegotiate               ctrl 3600 data 512000 required off timeout 300
TLSLog                       /var/log/proftpd/tls.log

Save the file after making the changes.

Stap 9: Configure Passive Mode Ports

FTP clients frequently use Passive Mode.

Open a passive port range through the firewall:

sudo firewall-cmd --add-port=1024-65534/tcp
sudo firewall-cmd --add-port=1024-65534/tcp --permanent

Verify the configuration:

sudo firewall-cmd --list-ports

Reload the firewall:

sudo firewall-cmd --reload

Stap 10: Configure SELinux

If SELinux is enabled, allow FTP read and write access:

sudo setsebool -P allow_ftpd_full_access=1

This permits ProFTPD to access files appropriately while SELinux remains active.

Stap 11: Generate a TLS Certificate

Create a self-signed certificate for TLS.

sudo openssl req -x509 -nodes -newkey rsa:2048 \
-keyout /etc/pki/tls/certs/proftpd.pem \
-out /etc/pki/tls/certs/proftpd.pem

During certificate generation, provide details such as:

Country Name
State or Province
City
Organization
Organizational Unit
Common Name
Email Address

The Common Name should typically match your server hostname.

Secure the Certificate

Restrict certificate access:

sudo chmod 0440 /etc/pki/tls/certs/proftpd.pem

This prevents unauthorized users from reading the certificate file.

Stap 12: Enable TLS Startup Option

Bewerking:

sudo nano /etc/sysconfig/proftpd

Locate:

PROFTPD_OPTIONS=""

Replace it with:

PROFTPD_OPTIONS="-DTLS"

This instructs ProFTPD to start with TLS support enabled.

Stap 13: Restart ProFTPD

Apply all changes:

sudo systemctl restart proftpd

Verify the service starts successfully:

sudo systemctl status proftpd

The TLS-enabled FTP server is now operational.

Optioneel: Enable Anonymous FTP Access

Anonymous FTP should only be enabled when absolutely necessary.

Because users are not authenticated, anonymous access introduces additional security considerations.

Add the following block to the end of:

/etc/proftpd.conf
<Anonymous ~ftp>
  User ftp
  Group ftp

  UserAlias anonymous ftp
  DirFakeUser on ftp
  DirFakeGroup on ftp
  MaxClients 10

  <Directory *>
    <Limit WRITE>
      DenyAll
    </Limit>
  </Directory>

</Anonymous>

Restart ProFTPD:

sudo systemctl restart proftpd

This configuration allows anonymous read-only access.

Connecting with FileZilla

FileZilla is one of the most popular FTP clients and supports FTP over TLS.

Create a New Site

Open:

File → Site Manager

Create a new connection profile.

Configure Connection Settings

Set:

Protocol: FTP
Encryption: Require Explicit FTP over TLS
Host: your-server-ip
Port: 21

Configure Login Credentials

For authenticated users:

Logon Type: Normal
Username: ftpuser
Password: your-password

For anonymous access:

Logon Type: Anonymous

Accept the TLS Certificate

During the first connection attempt, FileZilla will display the TLS certificate.

Review the certificate information and click:

OK

to trust the certificate.

After successful authentication, you will be connected securely through TLS.

Testing the TLS Configuration

To verify encryption is working:

Check FileZilla Logs

The connection log should indicate:

TLS connection established

Verify the TLS Log

Review:

cat /var/log/proftpd/tls.log

This log records TLS-related events and can help troubleshoot connection issues.

Confirm Secure Authentication

Ensure credentials are transmitted over encrypted sessions rather than plain FTP.

Beste praktijken op het gebied van beveiliging

Use Strong Passwords

All FTP users should use unique and complex passwords.

Limit Anonymous Access

Disable anonymous FTP unless a specific business requirement exists.

Restrict User Directories

Users should only have access to directories they require.

Keep Software Updated

Regularly update:

  • AlmaLinux
  • ProFTPD
  • OpenSSL

to receive security patches.

Use Trusted Certificates

For production deployments, replace self-signed certificates with certificates issued by a trusted Certificate Authority.

Monitor Logs

Regularly review:

  • ProFTPD logs
  • TLS logs
  • Authentication logs

to identify suspicious activity.

Building a Secure FTP Environment

ProFTPD provides a powerful and flexible FTP solution for AlmaLinux servers. When combined with TLS encryption, it offers a secure method for transferring files while protecting credentials and sensitive data from interception.

By implementing proper user permissions, secure certificates, firewall-regels, and ongoing maintenance procedures, administrators can deploy a reliable FTP service suitable for both internal and external file transfer requirements.

Deel dit bericht

Geef een reactie

Je e-mailadres wordt niet gepubliceerd. Vereiste velden zijn gemarkeerd met *