Efficient Steps To Set up ProFTPD on AlmaLinux 9 – OrcaCore

Posted on

Efficient Steps To Set up ProFTPD on AlmaLinux 9 - OrcaCore

Efficient Steps To Set up ProFTPD on AlmaLinux 9 – OrcaCore

This tutorial, brought to you by Orcacore, will guide you through the process of setting up ProFTPD on AlmaLinux 9. We’ll cover the installation, configuration, and basic usage of ProFTPD, allowing you to establish a secure and efficient FTP server on your AlmaLinux 9 system. Let’s dive in and learn how to Set up ProFTPD on AlmaLinux 9.

What is Proftpd Linux?

ProFTPD is a highly regarded, open-source FTP server software solution widely deployed across Unix and Linux environments. Its popularity stems from its robust feature set, encompassing virtual hosting capabilities, a modular architecture for enhanced flexibility, advanced security measures, and granular, user-based access controls. Crucially, ProFTPD is both free to use and designed with security as a primary concern.

Before you Set up ProFTPD on AlmaLinux 9, ensure you have access to your server as a non-root user with sudo privileges. A basic firewall setup is also required. Refer to Orcacore’s guide on Initial Server Setup with AlmaLinux 9 if you need assistance with these prerequisites.

Now, let’s proceed with the steps to Set up ProFTPD on AlmaLinux 9.

Step 1 – Install ProFTPD on AlmaLinux 9

Begin by updating your system packages to their latest versions. Use the following command:

sudo dnf update -y

ProFTPD packages are located in the EPEL (Extra Packages for Enterprise Linux) repository. If you haven’t already, install the EPEL repository on AlmaLinux 9:

sudo dnf install epel-release -y

Next, enable the PowerTools repository, which provides additional packages and dependencies:

sudo dnf config-manager --set-enabled crb

Finally, install ProFTPD using the following command:

sudo dnf install proftpd -y

After the installation, you’ll need to configure ProFTPD by modifying its configuration file. The next step covers this process.

Step 2 – Configure ProFTPD on AlmaLinux 9

Open the main ProFTPD configuration file, /etc/proftpd.conf, using your preferred text editor. Here, we’ll use the vi editor:

sudo vi /etc/proftpd.conf

Locate the ServerName directive within the file. Replace the default value with your server’s hostname. This ensures proper identification of the server in FTP clients.

ServerName "<mark>server's hostname</mark>"

Save the changes and close the file.

Step 3 – Configure Firewall Rules for ProFTPD

Assuming you have firewalld enabled, you need to allow traffic on port 21, the standard port for FTP connections. Use the following command to add a permanent rule:

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

Apply the new firewall rule by reloading the firewall:

sudo firewall-cmd --reload

Tips: For comprehensive information on firewalld configuration, consult Orcacore’s guide on FirewallD Configuration on AlmaLinux 9.

Step 4 – How To Start ProFTPD on AlmaLinux 9?

Start the ProFTPD service using the systemctl command:

sudo systemctl start proftpd

To ensure ProFTPD starts automatically at boot time, enable the service:

sudo systemctl enable proftpd

Verify that ProFTPD is running correctly by checking its status:

sudo systemctl status proftpd

The output should indicate that the service is active and running, similar to the image provided in the original article.

● proftpd.service - ProFTPD FTP Server
     Loaded: loaded (/usr/lib/systemd/system/proftpd.service; enabled; vendor preset: disabled)
     Active: active (running) since Tue 2023-10-27 10:00:00 UTC; 10s ago
       Docs: man:proftpd(8)
             http://www.proftpd.org/
    Process: 1234 ExecStart=/usr/sbin/proftpd (code=exited, status=0/SUCCESS)
   Main PID: 5678 (proftpd)
      Tasks: 1 (limit: 2345)
     Memory: 1.2M
        CPU: 50ms
     CGroup: /system.slice/proftpd.service
             └─5678 /usr/sbin/proftpd

Oct 27 10:00:00 almalinux9 systemd[1]: Starting ProFTPD FTP Server...
Oct 27 10:00:00 almalinux9 proftpd[5678]: ProFTPD 1.3.7c (stable) standalone mode
Oct 27 10:00:00 almalinux9 systemd[1]: Started ProFTPD FTP Server.

Step 5 – How To Access and Run ProFTPD from Linux Terminal?

To access the FTP server, you can use a web browser or a command-line FTP client. In a web browser, enter ftp://your_domain_or_ip_address. You’ll be prompted for your username and password.

Note: By default, users will only have access to their home directories.

Alternatively, you can access the FTP server from the command line:

ftp ftp://example.com

To exit the FTP shell, type exit.

For more advanced configuration options, refer to ProFTPD configuration examples.

Conclusion

You have now successfully learned how to Set up ProFTPD on AlmaLinux 9, configure its basic settings, manage the service, and access it from the command line.

Here are some related articles you might find helpful:

Follow Orcacore on Facebook, Instagram, and Twitter for more tutorials and updates.

Alternative Solutions for File Transfer on AlmaLinux 9

While ProFTPD is a solid choice for FTP serving, other options exist that offer different advantages, particularly in security and ease of use. Here are two alternative solutions for file transfer on AlmaLinux 9:

1. SFTP (Secure File Transfer Protocol) using OpenSSH:

SFTP is a secure protocol built on top of SSH (Secure Shell). It offers encrypted file transfers, protecting data in transit from eavesdropping and tampering. Because it leverages SSH, it often requires less configuration than a dedicated FTP server like ProFTPD. Most Linux distributions, including AlmaLinux 9, have OpenSSH installed by default, making SFTP readily available.

Explanation:

Instead of running a separate FTP server, SFTP utilizes the existing SSH infrastructure. Users authenticate using their SSH credentials, and file transfers occur over a secure SSH channel. This eliminates the need for separate FTP user management and reduces the attack surface, as only the SSH port (typically 22) needs to be open.

Implementation:

  • Ensure SSH is enabled: SSH is usually enabled by default. You can check its status with sudo systemctl status sshd. If it’s not running, start it with sudo systemctl start sshd and enable it to start on boot with sudo systemctl enable sshd.
  • Configure SSH (Optional): You can further secure SSH by disabling password authentication and requiring key-based authentication. Edit the /etc/ssh/sshd_config file and change PasswordAuthentication no and set up key-based authentication for users.
  • Firewall: Ensure port 22 (or your custom SSH port) is open in the firewall: sudo firewall-cmd --permanent --add-port=22/tcp followed by sudo firewall-cmd --reload.
  • User Access: Users can then connect using an SFTP client (like FileZilla or WinSCP) or the command-line sftp command: sftp username@your_server_ip.

Benefits:

  • Security: Encrypted transfers protect data from interception.
  • Simplicity: Leverages existing SSH infrastructure, reducing configuration overhead.
  • Ubiquity: SSH and SFTP clients are widely available.

2. Nextcloud/ownCloud (Cloud Storage Platform):

Nextcloud and ownCloud are self-hosted cloud storage platforms that offer a web-based interface for file management, sharing, and collaboration. They provide a more user-friendly experience than traditional FTP or SFTP, making them suitable for users who are not comfortable with command-line tools.

Explanation:

Nextcloud/ownCloud provides a complete solution for file storage and sharing, including user management, access control, versioning, and synchronization. Users can upload and download files through a web browser or use desktop/mobile clients to sync files across devices.

Implementation (Simplified Example using Docker):

This is a simplified Docker example. For a production setup, consult the official Nextcloud/ownCloud documentation.

# Install Docker (if not already installed)
sudo dnf install docker -y
sudo systemctl start docker
sudo systemctl enable docker

# Create a directory for Nextcloud data
mkdir nextcloud_data

# Run Nextcloud in a Docker container
docker run -d -p 8080:80 -v $(pwd)/nextcloud_data:/var/www/html nextcloud

Explanation of Docker Command:

  • docker run -d: Runs the container in detached mode (background).
  • -p 8080:80: Maps port 8080 on the host to port 80 inside the container (web access). Change 8080 if that port is already in use.
  • -v $(pwd)/nextcloud_data:/var/www/html: Mounts the nextcloud_data directory on the host to the Nextcloud data directory inside the container. This persists the data even if the container is stopped or removed.
  • nextcloud: Specifies the Nextcloud Docker image.

Accessing Nextcloud:

Open your web browser and navigate to http://your_server_ip:8080. You’ll be prompted to create an administrator account.

Benefits:

  • User-Friendly Interface: Web-based interface simplifies file management.
  • Collaboration Features: Supports file sharing, versioning, and collaboration.
  • Cross-Platform Compatibility: Accessible from web browsers, desktop clients, and mobile apps.
  • Advanced Features: Includes features like calendar, contacts, and document editing.

Both SFTP and Nextcloud/ownCloud offer viable alternatives to ProFTPD for file transfer on AlmaLinux 9, each with its own strengths and weaknesses. Choosing the right solution depends on your specific needs and priorities.

Leave a Reply

Your email address will not be published. Required fields are marked *