Skip to content
Advertisement

One Line FTP Server

A lot of times I used the command, which opens a temporary HTTP server on current directory:

python3 -m http.server

Now I need to receive files, is there any one-line command that opens a ftp server?

I am simply looking for a command line ftp server, no configurations files, no daemons.

I tried Twisted as in One line ftp server in python , but the user has no permission to send files…

Advertisement

Answer

If you are looking for a Python solution, check out pyftpdlib.

You can install it using e.g. pip:

pip install pyftpdlib

then run it like this:

python -m pyftpdlib

This runs the anonymous-writable FTP server at localhost, port 2121 by default, serving files from the current directory (i.e. from wherever you started it). To login, use anonymous as both username and password.

Obviously, this is very insecure, so you would have to take that into account – if you want anything more then a toy or something to work with in development etc., use a proper FTP server as others mentioned.

Advertisement