You can get an FTP server going as easy as one two three using pyftpdlib:
- Download ftpserver.py
sudo python ftpserver.py
- there is no step three :)
You now have an ftp server which you can log in to anonymously sharing your home directory. This is meant more as a test of the module, but it does what it says on the tin.
python ftpserver.py --directory=FTP --port=2121 --write
will serve, without root privileges, on port 2121 and grant write access to anonymous users. It will also use the directory
FTP in the current working directory instead of your home. Type
python ftpserver.py --help to get information about all the options.
- log into it at
To "install" the application, make it executable (open the file properties, go to permissions, and select executable for all) and move it to
sudo mv ftpserver.py /usr/bin/ftpserver). You can now start and ftp-server like so:
ftpserver --port=2121 --directory=/home/stefano/Projekte/
Please note that this software is released under the terms of the MIT License, which means you can do basically what ever you please with it. Read the license text, it's only a few lines, and know your rights.
Now, this script doesn't support username and password as part of it's stand-alone functionality (for security reasons I imagine).
So I've added that feature:
You now have, in addition to all options I mentioned, the command line parameters
python ftpserver.py --port=2121 --username=ftpuser --password=3r2u389r2u333j
--help to see them all.
This should be as easy as it gets.
I've also written a little gui for it:
Download it here (updated at rev. 6)
I'm sorry it's 3999 lines long, but it will do everything the original does. And i wanted to keep it all in one file.
When it's started without any parameters (i.e. make it executable and double click it, or create a launcher for it), it starts a little gui for you to configure your server. You can still import it as a python module or use the above command line fu.
I've not bothered with anything other than port 2121. This should be simple, making the port configurable requires complex error handling which I don't want the user to bother with. 2121 should always work fine.
It won't warn you, like the command line does, about using an insecure configuration. I.e. not setting a password or something like that.