How to Setup an Anonymous FTP Download Server in Fedora

FTP, short for File Transfer Protocol, is a standard network protocol that was ones generally used for transferring files between a client and server, now it has been replaced by more secure and faster ways of delivering files across networks.

Most of today’s casual internet users use web browsers over https to download files directly and command-line users are more likely to use secure network protocols such as the SCP or sFTP.

In this article, we will explain how to set up an anonymous FTP download server using secure vsftpd in Fedora Linux for widely distribute public files.

Step 1: Installing vsftpd in Fedora

First, we will begin by updating our software packages and then installing vsftp server using the following dnf commands.

$ sudo dnf update
$ sudo dnf install vsftpd
Install Vsftpd in Fedora
Install Vsftpd in Fedora

Next, start, enable and verify the vsftp server.

$ sudo systemctl start vsftpd
$ sudo systemctl enable vsftpd
$ sudo systemctl status vsftpd
Check Vsftpd Status
Check Vsftpd Status

Step 2: Configuring Anonymous FTP in Fedora

Next, open and edit your /etc/vsftpd/vsftpd.conf file to allow anonymous downloads with the following entries.

$ sudo vi /etc/vsftpd/vsftpd.conf

The following option controls whether anonymous logins are allowed or not. If enabled, both the usernames and anonymous are acknowledged as anonymous logins.

anonymous_enable=YES

The following option controls whether local logins are allowed. We will set this option to "NO" because we are not allowing local accounts to upload files via FTP.

local_enable=NO

The following setting controls whether any changes to the filesystem are allowed or not.

write_enable=NO

The following setting will prevent vsftpd from asking for an anonymous password. We will set this option to "YES" because we are allowing anonymous users to log in without asking a password.

no_anon_password=YES

Now enable the following setting to print all user and group information in directory listings as FTP.

hide_ids=YES

Finally, add the following options, which will limit the range of ports that can be used for passive style data connections.

pasv_min_port=40000
pasv_max_port=40001

Now that you’ve configured vsftpd, now open the ports in the firewall to allow vsftp connections along with the passive port range you defined in the configuration.

$ sudo firewall-cmd --add-service=ftp --perm
$ sudo firewall-cmd --add-port=40000-40001/tcp --perm
$ sudo firewall-cmd --reload

Next, configure SELinux to allow passive FTP.

$ sudo setsebool -P ftpd_use_passive_mode on

And finally, restart the vsftp server.

$ sudo systemctl start vsftpd

At the point, your anonymous FTP server is ready, now you can add your files in /var/ftp directory (usually, system administrators place publicly downloadable files under /var/ftp/pub).

Step 3: Testing Anonymous FTP Access

Now you can connect to your anonymous FTP server using a web browser or an FTP client on another system. To connect from a web browser enter the IP address of your server.

ftp://192.168.0.106

If everything is working as anticipated, you should see the pub directory.

Check FTP from Browser
Check FTP from Browser

You can also test your FTP server from the command-line using an Ftp client with passive mode using -p option as shown. When asked for a username, you can type either “ftp” or “anonymous”.

$ ftp -p 192.168.0.106
Connect FTP Client from Terminal
Connect FTP Client from Terminal
Conclusion

In this article, we have explained how to install and configure vsftpd server for anonymous downloads only in Fedora Linux. If you face any problems during set up, feel free to ask the question in the comment section below.

If you read this far, tweet to the author to show them you care. Tweet a thanks
Ravi Saive
I am an experienced GNU/Linux expert and a full-stack software developer with over a decade in the field of Linux and Open Source technologies

Each tutorial at TecMint is created by a team of experienced Linux system administrators so that it meets our high-quality standards.

Join the TecMint Weekly Newsletter (More Than 156,129 Linux Enthusiasts Have Subscribed)
Was this article helpful? Please add a comment or buy me a coffee to show your appreciation.

1 thought on “How to Setup an Anonymous FTP Download Server in Fedora”

  1. I followed the step-by-step instructions to install configure and start the vsftpd server, but one thing. I am having a hard time finding the IP address for the vsftpd server that I set up, can you give me instructions on how I can find the IP.

    Reply

Got something to say? Join the discussion.

Thank you for taking the time to share your thoughts with us. We appreciate your decision to leave a comment and value your contribution to the discussion. It's important to note that we moderate all comments in accordance with our comment policy to ensure a respectful and constructive conversation.

Rest assured that your email address will remain private and will not be published or shared with anyone. We prioritize the privacy and security of our users.