dotlinux blog

Enable Anonymous Account for Proftpd Server in RHEL/CentOS 7

ProFTPD is a popular, highly configurable FTP server for Unix-like systems, including RHEL and CentOS 7. Enabling an anonymous account on a ProFTPD server can be useful in scenarios where you want to allow users to download files without requiring them to authenticate with a specific username and password. This blog post will guide you through the step-by-step process of enabling an anonymous account for a ProFTPD server in RHEL/CentOS 7.

2026-06

Table of Contents#

  1. Prerequisites
  2. Install ProFTPD
  3. Configure ProFTPD for Anonymous Access
  4. Create the Anonymous Directory
  5. Set Up Appropriate Permissions
  6. Restart and Enable ProFTPD
  7. Test the Anonymous FTP Access
  8. Security Considerations
  9. Conclusion
  10. References

Prerequisites#

  • A RHEL/CentOS 7 system with root or sudo privileges.
  • Basic knowledge of the Linux command line.
  • Internet connectivity to install packages.

Install ProFTPD#

First, you need to install the ProFTPD server on your system. Follow these steps:

  1. Update the system's package repositories:
sudo yum update -y
  1. Enable the EPEL repository (ProFTPD is not included in the default RHEL/CentOS 7 repositories):
sudo yum install epel-release -y
  1. Install ProFTPD:
sudo yum install proftpd -y

Configure ProFTPD for Anonymous Access#

Next, you'll need to modify the ProFTPD configuration file to enable anonymous access:

  1. Open the ProFTPD configuration file using your preferred text editor. The default configuration file is /etc/proftpd.conf:
sudo vi /etc/proftpd.conf
  1. Find and add or modify the following lines in the configuration file. If these lines don't exist, you can add them to the end of the file:
# Enable anonymous access
<Anonymous ~ftp>
    User ftp
    Group ftp
    RequireValidShell off
    # Limit access to read - only
    <Limit WRITE>
        DenyAll
    </Limit>
</Anonymous>

In this configuration:

  • <Anonymous ~ftp> defines an anonymous login section. The ~ftp refers to the home directory of the ftp user.
  • User ftp and Group ftp specify that anonymous users will operate under the ftp user and group.
  • The <Limit WRITE> block restricts anonymous users from writing to the server.

Create the Anonymous Directory#

Anonymous users will access files in a specific directory. You need to create this directory:

  1. Create the directory:
sudo mkdir -p /var/ftp/pub
  1. Place some sample files in the directory for testing purposes:
sudo touch /var/ftp/pub/testfile.txt

Set Up Appropriate Permissions#

To ensure that anonymous users can access the files, you need to set the correct permissions:

sudo chown -R ftp:ftp /var/ftp
sudo chmod -R 555 /var/ftp

The chown command changes the owner and group of the /var/ftp directory to the ftp user and group. The chmod command sets the directory and its contents to be readable and executable by all users.

Restart and Enable ProFTPD#

After making the configuration changes, you need to restart and enable ProFTPD:

sudo systemctl restart proftpd
sudo systemctl enable proftpd

The restart command restarts the ProFTPD service, and the enable command ensures that the service starts automatically at boot time.

Test the Anonymous FTP Access#

You can test the anonymous FTP access using an FTP client. On the command line, you can use the ftp utility:

ftp <your_server_ip>

When prompted for a username, enter anonymous. For the password, you can enter any valid email address or just press Enter. If the connection is successful, you should be able to list the files in the /pub directory:

ftp> ls

Security Considerations#

  • Read - Only Access: As shown in the configuration, it's recommended to limit anonymous users to read - only access to prevent unauthorized modifications.
  • File and Directory Permissions: Ensure that only necessary files are accessible to anonymous users and that all other sensitive directories are properly protected.
  • Firewall Configuration: Configure your firewall to allow only FTP traffic on the appropriate ports (usually port 21). You can use firewalld to manage your firewall rules:
sudo firewall-cmd --permanent --add-service=ftp
sudo firewall-cmd --reload

Conclusion#

Enabling an anonymous account for a ProFTPD server in RHEL/CentOS 7 is a straightforward process that involves installing the server, configuring it for anonymous access, creating an appropriate directory, and setting up the necessary permissions. By following the steps outlined in this blog post, you can provide a simple way for users to download files from your server without the need for authentication.

References#