亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区
Chinaunix
標(biāo)題:
:wink: 使用pyftpdlib 時發(fā)生錯誤
[打印本頁]
作者:
nmweizi
時間:
2012-11-16 09:22
標(biāo)題:
:wink: 使用pyftpdlib 時發(fā)生錯誤
環(huán)境 python 2.7 pyftpdlib 0.7.0 ubuntu 12.04
執(zhí)行python ftps-server.py
用 python 2.7 帶的ftplib就可以
In [1]: from ftplib import FTP_TLS
In [2]: ftps = FTP_TLS('127.0.0.1','user','bbbb')
error_perm: 530 Authentication failed.
使用lftp 登錄 ftps時提示錯誤
lftp ftps://fa:aa@127.0.0.1:21
lftp
fa@127.0.0.1
:~> ls
ls: Fatal error: gnutls_handshake: A TLS packet with unexpected length was received.
大家?guī)兔纯词裁丛蛄耍?img src="static/image/smiley/default/icon_question.gif" smilieid="63" border="0" alt="" />
ftps_server.py代碼如下:
from pyftpdlib import ftpserver
from pyftpdlib.contrib.handlers import TLS_FTPHandler,FTPHandler
import md5
class MyHandler(TLS_FTPHandler):
def on_login(self, username):
# do something when user login
print 'username:%s' % username
def on_login_failed(self, username, password):
print 'afasfd-----------------------------------'
print 'password:%s' % password
def on_logout(self, username):
# do something when user logs out
pass
def on_file_sent(self, file):
# do something when a file has been sent
pass
def on_file_received(self, file):
# do something when a file has been received
pass
def on_incomplete_file_sent(self, file):
# do something when a file is partially sent
pass
def on_incomplete_file_received(self, file):
# remove partially uploaded files
pass
authorizer = ftpserver.DummyAuthorizer()
authorizer.add_user('user', '12345', '.', perm='elradfmw')
#authorizer.add_anonymous('.')
handler = MyHandler
handler.certfile = 'keycert.pem'
handler.authorizer = authorizer
# requires SSL for both control and data channel
#handler.tls_control_required = True
#handler.tls_data_required = True
ftpd1 = ftpserver.FTPServer(('127.0.0.1', 21), handler)
ftpd1.serve_forever()
復(fù)制代碼
作者:
nmweizi
時間:
2012-11-16 21:23
搞定。
lftp
ftp://fa:aa@127.0.0.1:21
不知到為什么會這樣?
那位高人能幫助解釋一下啊
歡迎光臨 Chinaunix (http://www.72891.cn/)
Powered by Discuz! X3.2