views:

33

answers:

1

I use python ftplib to connect to a ftp server which is running on active mode; That means the server will connect my client machine on a random port when data is sent between us.

Considering security issue, Can I specify the client's data port (or port range) and let the server connect the certain port?

Many Thanks for your response.

A: 

There is no way to do this with the standard ftplib module.

You're either going to have find an alternate library which offers this functionality or monkey-patch the makeport() method on your FTP object if you're feeling brave.

Dave Webb
Thanks for Dave's advice~~ May I ask that is there a commoand line way to accomplish this?
bluesea007