Last active
December 21, 2015 02:49
-
-
Save minustore/1b1a597b32c450a90a68 to your computer and use it in GitHub Desktop.
simple ftp use pyftpdlib
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pyftpdlib.authorizers import DummyAuthorizer | |
from pyftpdlib.handlers import FTPHandler | |
from pyftpdlib.servers import FTPServer | |
user = "user" | |
passwd = "passwd" | |
filepath = "./" | |
ip = "0.0.0.0" | |
port = 21 | |
#address = "123.123.123.123" | |
authorizer = DummyAuthorizer() | |
authorizer.add_user(user, passwd, filepath, perm="elradfmw") | |
handler = FTPHandler | |
handler.authorizer = authorizer | |
#handler.masquerade_address = address | |
# use passive ports 8080 | |
#handler.passive_ports = range(8080, 8081) | |
server = FTPServer((ip, port), handler) | |
server.serve_forever() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment