Questions tagged [passive-mode]

FTP and FTPS use multiple connections to perform file transfers. In passive mode (a.k.a. PASV), both control and data connections are made from the FTP client to the FTP server.

FTP may run in active or passive mode, which determines how the data connection is established.

In both cases, the client creates a TCP control connection from a random unprivileged port N to the FTP server command port 21. In active modes, the client starts listening for incoming data connections on port N+1 from the server (the client sends the FTP command PORT or EPRT to inform the server on which port it is listening).

In situations where the client is behind a firewall and unable to accept incoming TCP connections, passive mode may be used.

In this mode, the client uses the control connection to send a PASV or EPSV command to the server and then receives a server server port number from the server, which the client then uses to open a data connection from an arbitrary client port to the server IP address and server port number received.

See What is the difference between active and passive FTP?

59 questions
39
votes
2 answers

How to get port in FTP protocol from passive mode?

When I entered passive mode in FTP, I have got: 227 Entering Passive Mode (213,180,204,183,230,205). First 4 numbers are the IP addresses, but what are the two last? Are they two ports?
Secret
  • 2,627
  • 7
  • 32
  • 46
10
votes
1 answer

How to enable FTP Passive Mode for Amazon EC2 server with IIS

I originally had the issue when using pagelime which required users to use passive mode and did not support active mode. Getting active mode to work was pretty straight forward but getting passive to work took a lot more effort. I am using a Amazon…
Kalel Wade
  • 7,742
  • 3
  • 39
  • 55
5
votes
1 answer

FTP data connections reuse

I am working on an FTP client for kicks and I am trying to understand the workflow of data connections. As I understand, the initial (command) connection is permanent until you quit. However, I am unsure of the data connection - is it re-initiated…
Christian P.
  • 4,784
  • 7
  • 53
  • 70
4
votes
2 answers

How can I enable passive mode while using JSch as SFTP client?

I'm using JSch as SFTP client and now I need to enable passive mode because of some limitation of security. But I can not found a way to enable passive mode. Can somebody tell me how to do this?
Sky
  • 51
  • 1
  • 1
  • 2
3
votes
3 answers

Is it possible to use "Passive Mode" with FtpWebRequest

We have a process in place to upload a file nightly to a partner FTP site. They now require a passive connection and our uploads now fail. Is it possible for the .NET 4 FtpWebRequest to implement a passive connection instead of an active one? If so,…
James Alexander
  • 6,132
  • 10
  • 42
  • 56
3
votes
3 answers

"php_connect_nonb() failed: Operation now in progress (115)" with TLS/SSL-encrypted FTP connection in PHP - Unencypted connection works

I'm trying to use an automatic backup script for cPanel accounts of my server. I have mounted an FTP server in one local machine with FileZilla Server. I can connect and transfer files successfully with FileZilla client, a Plesk server, and…
Daniel P.
  • 184
  • 1
  • 3
  • 16
3
votes
3 answers

LuaSocket FTP always times out

I've had success with LuaSocket's TCP facility, but I'm having trouble with its FTP module. I always get a timeout when trying to retrieve a (small) file. I can download the file just fine using Firefox or ftp in passive mode (on Ubuntu Dapper…
John Zwinck
  • 239,568
  • 38
  • 324
  • 436
3
votes
1 answer

How use Passive-Mode in FtpWebRequest & fix PASV error in .Net 3.5 & Define port-range by codes

please see my windows form codes first : using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using…
SilverLight
  • 19,668
  • 65
  • 192
  • 300
3
votes
1 answer

WinSCP command-line passive mode

I am calling WinSCP via command line but I can't figure out how to set passive mode properly to the script. Here is the script now: option batch on option confirm off open ftp://user_and_pass_details:21 cd /out/ option transfer binary put…
2
votes
1 answer

Custom FTP client PASV data connection refused

Going to try and be brief I've written a custom FTP implementation using c# .net 3.5. The system uses TcpClient (TcpListener for active mode) for managing connections. Been getting strange behavior in a single instance and I would like to ask for…
Gusdor
  • 14,001
  • 2
  • 52
  • 64
2
votes
1 answer

Netbeans Cannot list file for Reason: 227 Entering Passive Mode

I am using remote server with netbeans 8.2 before that, but suddenly it stopped and gives me this error when i try to make synchronize. Cannot list file for Reason: 227 Entering Passive Mode. In manage Remote Connections every thing looks good and…
2
votes
1 answer

Custom PHP FTP server: The client gets disconnected after sending LIST command

I'm going to write from scratch an FTP server mainly to understand how client/socket FTP communication works and to try to develop some customized functionalities. I have a doubts on how server treats the PASV command received from the client as…
Stefano Radaelli
  • 1,088
  • 2
  • 15
  • 35
2
votes
0 answers

Sending "227 \r\n" on port 21 terminates connection

Let me start off by stating that this is my first post here on stackoverflow. Feel free to point out any mistakes made while posting. Okay, so the problem at hand is a little weird. I'm currently implementing the FTP protocol for my project, but ran…
DarkZero
  • 51
  • 5
2
votes
1 answer

FTP clients Filezilla and Ftpuse work, but Windows Explorer cannot engage PASV mode

I created a custom FTP server using .NET 4.0. I am running both the client and server on the same Windows 7 machine, and my firewall is entirely disabled. I can connect to it using both FileZilla and FtpUse, establish PASV mode, and browse the…
Dan
  • 1,215
  • 1
  • 10
  • 22
2
votes
1 answer

Regarding the usage of .Net ftp classes & passive mode c#

We all know that .Net has ftp related classes and i have often saw people always use few property of ftp called: wrq.KeepAlive = false; wrq.UseBinary = false; wrq.UsePassive = true; Can anyone tell me what is the meaning of KeepAlive, UseBinary &…
Thomas
  • 33,544
  • 126
  • 357
  • 626
1
2 3 4