FTP: Setup a simple (read only) FTP server without install everything

Hi,

for some reasons, for example firmware updatse of IoT devices you need a readonly/anonymous FTP server and you don’t wont install and configure a whole ftp solution for this.

The python module twisted offers such a simple server. The ftp server must started with root privileges because it uses a port <1024. I always create a virtual python environment (ftp-venv) for such things.

michael@debdev ~ # sudo apt install python3 python3-pip python3-venv
michael@debdev ~ # python3 -m venv /home/michael/ftp-venv
michael@debdev ~ # sudo su
root@debdev ~ # source /home/michael/ftp-venv/bin/activate
root@debdev ~ # pip install twisted
root@debdev ~ # mkdir -p 
root@debdev ~ # twistd -n ftp -p 21 -r /tmp/tftp

Copy the files you want to serve to /tmp/tftp

Michael

Advertisment to support michlstechblog.info