-
-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathftp.py
More file actions
executable file
·23 lines (19 loc) · 620 Bytes
/
Copy pathftp.py
File metadata and controls
executable file
·23 lines (19 loc) · 620 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#! /usr/bin/env python3
from sys import argv,exit
from pyftpdlib.authorizers import DummyAuthorizer
from pyftpdlib.handlers import FTPHandler
from pyftpdlib.servers import FTPServer
import os
if len(argv) != 2:
print("usage:", os.path.basename(argv[0]), "PORT")
print()
exit(1)
authorizer = DummyAuthorizer()
authorizer.add_user("user", "password", ".", perm="elradfmw")
authorizer.add_anonymous(".")
handler = FTPHandler
handler.authorizer = authorizer
handler.passive_ports = range(60000, 64001)
address = ("0.0.0.0", argv[1])
ftpd = FTPServer(address, handler)
ftpd.serve_forever()