简体   繁体   中英

Python module ftplib FTP_TLS - Error 530

I'm using Python 2.7 on ubuntu 11.10 distribution.

I have a problem with ftplib module and FTP_TLS connection. On my ftp server there is vsftp

When try a connection I receive this error:

ftplib.error_perm: 530 Please login with USER and PASS.

This is my code:

from ftplib import FTP_TLS
ftp =  FTP_TLS( '192.168.1.5' )
ftp.login( 'user' , 'password') 
ftp.close()

Anyway if I use the simple FTP connection, ftp = FTP('192.168.1.5') , it works!

But I need FTP_TLS connection. I tried also to insert param ftp.auth() and ftp.prot_p() but nothing happens.

The FTP_TLS class doesn't seem to handle logins very well right now. Unfortunately, you have to explicitly send those commands to the server yourself.

from ftplib import FTP_TLS

# Do *not* specify the user and password in the FTP_TLS constructor arguments.
# Doing so will cause ftplib to try to login, resulting in the 530 error.
ftp = FTP_TLS('ftp.somewhere.com')
ftp.sendcmd('USER myusername') # '331 Please specify the password.'
ftp.sendcmd('PASS mypassword') # '230 Login successful.'

尝试TLS LiteM2Crypto都是 FTP/TLS 客户端和服务器。

Hi Guys I have the same problem. I'm using pyspark in my databricks notebook. When I try to connect using FTP it's working but for SFTP not. Same error like @A Pass Programm Can somebody help. Is it maybe something on server side, some certificate or something similar? Thanks for the help!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM