Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #82256 > unrolled thread

Re: Ftplib.FTP_TLS Ports

Started byChris Angelico <rosuav@gmail.com>
First post2014-12-10 15:18 +1100
Last post2014-12-10 15:18 +1100
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Ftplib.FTP_TLS Ports Chris Angelico <rosuav@gmail.com> - 2014-12-10 15:18 +1100

#82256 — Re: Ftplib.FTP_TLS Ports

FromChris Angelico <rosuav@gmail.com>
Date2014-12-10 15:18 +1100
SubjectRe: Ftplib.FTP_TLS Ports
Message-ID<mailman.16789.1418185094.18130.python-list@python.org>
On Wed, Dec 10, 2014 at 3:13 PM, Eric <seag33k@gmail.com> wrote:
> We are trying to open our firewall but it keeps failing.  The docs state
> that the default port is 21 and we've opened port 21.  I've ran tcpdump on
> the box while running the script.  I see a destination port of 21, but there
> seems to be random destination ports such as 2320 which follow.  If we open
> the firewall to allow all traffic, the script works.  Here is a snip of what
> I have for the ftp portion.  Any ideas would be helpful.
>
> import ftplib
>
> session = ftplib.FTP_TLS('xxx.ftp.com','user','password')
> file = open('Bkup.tar.gz','rb')
> session.storbinary('STOR Bkup.tar.gz', file)
> file.close()
> session.quit()

FTP works with two (or more) connections: one on the control port, and
one (or more) on data ports. You'd have to check out what the server
is using for data ports, and then open that range. For instance, it
might be configured to use 2300-2350 for data ports, in which case you
could permit all of those ports.

ChrisA

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web