Allow Anonymous Read Only FTP via VSFTPD

Saturday, January 3rd, 2015

Anonymous VSFTPD Setup (Read Only)

Configuration:

In order to enable anonymous FTP connections to a particular directory while still supporting authentication for virtual users for their files via PAM isn't that difficult.  Install VSFTPD if you haven't done so already by running the following command:

sudo apt-get install vsftpd

Create a backup of your existing VSFTPD confiugration file (this guide assumes you have already installed vsftpd):

sudo cp /etc/vsftpd.conf /etc/vsftpd.conf.bak

Next, let's edit the file:

sudo nano /etc/vsftpd.conf

Add the following lines to your configuration file:

anonymous_enable=YES
anon_root={INSERT_PATH_TO_ANONYMOUS_DIRECTORY}
anon_mkdir_write_enable=NO
anon_upload_enable=NO

Adding these lines enables anonymous FTP to the specified directory where files can be read and downloaded only.  Anonymous users cannot write, delete, change, or modify files because of the anon_mkdir_write_enable=NO and the anon_upload_enable=NO configuration lines.  For your changes to take effect, restart vsftpd.

sudo service vsftpd restart

You're done!