Install vsftpd
# Install
sudo apt update
sudo apt install vsftpd
sudo cp /etc/vsftpd.conf /etc/vsftpd.conf.orig
# Firwall rules
sudo ufw allow ftp-data
sudo ufw allow ftp
sudo ufw status
# Preparing Space for Files
sudo mkdir -p mapftp
sudo chown nobody:nogroup mapftp
echo "vsftpd test file" | sudo tee mapftp/test.log
sudo mkdir mapftp/maps/
sudo chmod a+rwx mapftp/maps/
Configure Anonymous Access
- Edit /etc/vsftpd.conf
- Change the following:
anonymous_enable=YES
to allow anonymous accesswrite_enable=YES
to enable uploadinganon_upload_enable=YES
to enable anonymous uploadinganon_mkdir_write_enable=YES
to enable anonymous directory creation
- Append the following to the end:
1.
anon_umask=022
so that new file will be readable by groups and other users. Uploaded files will have a permittion set to the value offile_open_mode
(by default, 0666) subtracted byanon_umask
.
anon_other_write_enable=YES
to enable anonymous deletion and renaminganon_root=xxx/mapftp
sets the root folder for anonymous loginsno_anon_password=YES
stops prompting for a password on the command line.hide_ids=YES
shows the user and group asftp:ftp
, regardless of the owner.pasv_min_port=40000
andpasv_max_port=50000
limits the range of ports that can be used for passive FTP
- Optionally changes the listening port:
listen_port=
followed by port number
Conclusion
On Linux, use the ftp command to access the server, e.g. ftp -p 192.168.0.2
then followed by anonymous
as the username. On Windows, use Windows Explorer or other FTP tools.
While not immediately useful for me, this outline was invaluable in helping someone else configure vsftpd to accept anonymous connections. Worked like a charm. Thank you for putting this together.