veeso / suppaftp

a super FTP/FTPS client library for Rust with support for both passive and active mode
Apache License 2.0
121 stars 31 forks source link

Which ports to open on the firewall? #74

Closed frederikhors closed 8 months ago

frederikhors commented 8 months ago

I'm using for the first time today this crate and I'm super happy.

On my local machine everything works.

On production machine it does not.

On production machine there is a firewall and I don't know which which ports to be open.

Let's say I'm using the passive mode (by default) I think I need to open the port 21 at least.

And in fact it works partially: it creates directories an files but do not send any data.

What other port do I need?

veeso commented 8 months ago

It depends on the ftp server configuration. You should configure in your server which port range to use for passive mode and open those ports. (e.g. 50000-51000)

frederikhors commented 8 months ago

Thanks. But what if I don't know which ports server uses?

Is there a way to tell the server: "please use this port range"?

veeso commented 8 months ago

I mean, if the server is yours and you can configure the server, you can usually set the port range in the server configuration. Otherwise the only viable option is to use Active mode instead of Passive mode, but in that case you'll have to expose the port 20 on your local machine.

frederikhors commented 8 months ago

Thanks.