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=YESto allow anonymous accesswrite_enable=YESto enable uploadinganon_upload_enable=YESto enable anonymous uploadinganon_mkdir_write_enable=YESto enable anonymous directory creation
- Append the following to the end:
1.
anon_umask=022so 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=YESto enable anonymous deletion and renaminganon_root=xxx/mapftpsets the root folder for anonymous loginsno_anon_password=YESstops prompting for a password on the command line.hide_ids=YESshows the user and group asftp:ftp, regardless of the owner.pasv_min_port=40000andpasv_max_port=50000limits 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.