Skip to content

Instantly share code, notes, and snippets.

@ryubro
Created February 5, 2015 08:21
Show Gist options
  • Save ryubro/33f5e76ca49dff122097 to your computer and use it in GitHub Desktop.
Save ryubro/33f5e76ca49dff122097 to your computer and use it in GitHub Desktop.
현재 폴더에서 FTP 서버를 실행해주는 python 코드
from pyftpdlib.authorizers import DummyAuthorizer
from pyftpdlib.handlers import FTPHandler
from pyftpdlib.servers import FTPServer
import os
authorizer = DummyAuthorizer()
path = os.getcwd()
authorizer.add_user("user", "pass", path, perm="elradfmw")
handler = FTPHandler
handler.passive_ports = range(60000, 65535)
handler.authorizer = authorizer
server = FTPServer(("", 21), handler)
server.serve_forever()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment