#!/usr/bin/python
# coding:utf-8

from pyftpdlib.authorizers import DummyAuthorizer
from pyftpdlib.handlers import FTPHandler
from pyftpdlib.servers import FTPServer

# 设置权限
authorizer = DummyAuthorizer()
authorizer.add_user("name", "Ui9123DRT0_253D", "/opt/ftpserver", perm="elradfmwM")
# 添加匿名用户
# authorizer.add_anonymous("/opt/ftpserver")
handler = FTPHandler
handler.authorizer = authorizer
# 开启服务器,127.0.0.1则是只有本地访问
server = FTPServer(("192.168.2.1", 8888), handler)
server.serve_forever()

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注

Captcha Code