In
ftp = FTP('ftp.centizen.ca','21')
the '21' is taken as being the userid. Leave it out.
If you want to use a port different from 21, for example 2121, you need to
ftp=FTP()
ftp.connect('ftp.centizen.ca', 2121)
Question
Hello there everyone!
I am trying to write a script to automate various mundane tasks involved with my FTP server.
I was planning on using ftplib to connect and interface with the FTP server, but I am having some issues connecting to the server as my usual user.
here is the code I am using, password changed for obvious reasons:
from ftplib import FTP
ftp = FTP('ftp.centizen.ca','21')
ftp.login('centizen@centizen.ca','password')
ftp.retrlines('LIST')
I get an error 530 from this. Any ideas on why?
I am certain that my credentials, including the password, are spelled correctly as they work when directly copied and pasted into filezilla. Is there something I am missing here?
Thanks!
Solution
In
ftp = FTP('ftp.centizen.ca','21')
the '21' is taken as being the userid. Leave it out.
If you want to use a port different from 21, for example 2121, you need to
ftp=FTP()
ftp.connect('ftp.centizen.ca', 2121)