2017-01-21 8 views
0

내 FTP 서버에 연결하는 스크립트를 작성하고 싶지만 나에게 적합하지 않습니다.Python ftplib.error_perm : 530 로그인 인증에 실패했습니다.

from ftplib import FTP 
ftp=FTP() 
ftp.set_debuglevel(2) 
ftp.connect('192.169.137.100') 
ftp.login('test','test') 
ftp.dir() 
ftp.close() 

및 빌드 스크립트, 나는이 정보

*get* '220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------\r\n' 
*get* '220-You are user number 1 of 50 allowed.\r\n' 
*get* '220-Local time is now 23:46. Server port: 21.\r\n' 
*get* '220-This is a private system - No anonymous login\r\n' 
*get* '220 You will be disconnected after 15 minutes of inactivity.\r\n' 
*resp* '220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------\n220-You are user number 1 of 50 allowed.\n220-Local time is now 23:46. Server port: 21.\n220-This is a private system - No anonymous login\n220 You will be disconnected after 15 minutes of inactivity.' 
*cmd* 'USER test' 
*put* 'USER test\r\n' 
*get* '331 User test OK. Password required\r\n' 
*resp* '331 User test OK. Password required' 
*cmd* 'PASS ****' 
*put* 'PASS ****\r\n' 
*getTraceback (most recent call last): 
File "D:\photoWebSite\py_test.py", line 9, in <module> 
* '530 Login authentication failed\r\n' 
*resp* '530 Login authentication failed' 
    ftp.login('test','test') 
    File "D:\LinuxSL\python27\lib\ftplib.py", line 393, in login 
    if resp[0] == '3': resp = self.sendcmd('PASS ' + passwd) 
File "D:\LinuxSL\python27\lib\ftplib.py", line 249, in sendcmd 
    return self.getresp() 
File "D:\LinuxSL\python27\lib\ftplib.py", line 224, in getresp 
    raise error_perm, resp 
ftplib.error_perm: 530 Login authentication failed 

내가 도움이 희망을 받았을 때하시기 바랍니다.

+0

내 FTP 서버에 연결할 수 있습니다. –

답변

0

당신은 다음과 같은 FTP_TLS를 사용하려고 할 수 있습니다 : 나는 명령 줄을 사용하는 경우

from ftplib import FTP_TLS 
ftp=FTP_TLS() 
ftp.set_debuglevel(2) 
ftp.connect('192.169.137.100', 22) 
ftp.sendcmd('USER test') 
ftp.sendcmd('PASS test') 
ftp.dir() 
ftp.close()