FTP

How To Set Up ProFTPD on CentOS 8

ProFTPD (Professional FTP Daemon) is a highly configurable and secure FTP server that is widely used to manage file transfer services. In this blog post, we will guide you through the steps to set up ProFTPD on a CentOS 8 server, allowing you to provide FTP services efficiently.

Prerequisites

Before we begin, ensure you have the following:

  • A CentOS 8 server with a non-root user having sudo privileges.
  • Firewall configured to allow FTP traffic (Ports 20, 21).
  • Basic knowledge of how to use the command line.

Step 1: Update Your System

To ensure that all packages are up to date, start by executing the following command:

sudo dnf update -y

Step 2: Install EPEL Repository

ProFTPD is not available in the default CentOS 8 repositories, so you will need to enable the EPEL (Extra Packages for Enterprise Linux) repository:

sudo dnf install epel-release -y

Step 3: Install ProFTPD

Now that you have the EPEL repository enabled, you can install ProFTPD with the following command:

sudo dnf install proftpd -y

Once the installation completes, you should see ProFTPD added to your system.

Step 4: Configure ProFTPD

The main configuration file for ProFTPD is located at /etc/proftpd.conf. You can use your preferred text editor to edit this file. We will use nano for this example:

sudo nano /etc/proftpd.conf

Here are some basic configurations you might consider adding or modifying:

  1. Set the Server Name:
   ServerName "ProFTPD Server"
  1. Disable Default Root Login:
    To prevent users from accessing the root directory:
   RootLogin off
  1. Use Passive Mode:
    It’s a good practice to set up passive mode for better firewall compatibility. Add the following lines to the configuration:
   PassivePorts 49152 65534
  1. Create a New User and Group:
    If you want to create a specific user with limited access:
   <IfModule mod_auth.c>
     AuthOrder mod_auth_file.c
     <Limit LOGIN>
       AllowUser myuser
       DenyAll
     </Limit>
   </IfModule>

(Replace myuser with your username.)

Once you finish modifying the configuration, save and exit the editor (in nano, press CTRL + X, then Y, then ENTER).

Step 5: Allow FTP Service Through the Firewall

To ensure that your server can receive FTP connections, you will need to open the FTP ports in the firewall. Execute the following commands:

sudo firewall-cmd --permanent --add-service=ftp
sudo firewall-cmd --permanent --add-port=49152-65534/tcp
sudo firewall-cmd --reload

Step 6: Start and Enable ProFTPD

To start the ProFTPD service and ensure it starts on boot:

sudo systemctl start proftpd
sudo systemctl enable proftpd

You can check the status of the ProFTPD service by running:

sudo systemctl status proftpd

If everything is configured correctly, you should see an active status message.

Step 7: Testing Your FTP Server

Now that your ProFTPD server is up and running, it’s time to test it. You can use an FTP client like FileZilla or even the command line. To test from the command line, simply run:

ftp your_server_ip

Replace your_server_ip with the actual IP address of your server. You should be able to log in using the credentials you’ve set up.

Conclusion

Setting up ProFTPD on CentOS 8 is a straightforward process that can provide a secure and reliable FTP server for your file transfer needs. With proper configuration and attention to security, ProFTPD can serve both personal and business use cases effectively.

Remember to monitor your logs at /var/log/proftpd/ for any issues and ensure your server is updated regularly.

Happy FTPing!