import os from pyftpdlib.authorizers import DummyAuthorizer from pyftpdlib.handlers import FTPHandler from pyftpdlib.servers import FTPServer authorizer = DummyAuthorizer() handler = FTPHandler def add_users_to_server(authorizer): authorizer.add_user('shizzer', 'uqcvjzpfuxpccr', '/home/shizzer', perm='elradfmwMT') authorizer.add_anonymous(os.getcwd()) def control_connection(authorizer, handler): handler.authorizer = authorizer def start_server(handler): """ Listen on port 21, every host can connect to the server Set max connections per ip to the server and just max connections """ address = ('', 21) server = FTPServer(address, handler) server.max_cons_per_ip = 5 server.max_cons = 100 server.serve_forever() add_users_to_server(authorizer) control_connection(authorizer, handler) start_server(handler)
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question