Today from the public network server connection to the Local intranet FTP server copy file, the system always prompt 227 Entering Passive Mode (xxx,xxx,,xxx,xxx,x), it is very strange, so the Internet to find information carefully studied a bit, The original FTP has two modes of operation, port mode and PASV mode, the Chinese meaning is active and passive, the details are as follows:
Active FTP:
Command connection: client >1024 port → Server 21 port
Data connection: Client >1024 port ← Server 20 Port
Passive FTP:
Command connection: client >1024 port → Server 21 port
Data connection: Client >1024 port ← Server >1024 Port
The port (Active) connection process is: The client sends a connection request to the server's FTP port (by default, 21), the server accepts the connection, and establishes a command link. When the data needs to be transferred, the client tells the server with the Port command on the command link: "I opened the ***x port and you came over to connect me." The server then sends a connection request from Port 20 to the client's ***x port, creating a data link to transmit the data.
The PASV (passive) connection process is: The client sends a connection request to the server's FTP port (by default, 21), the server accepts the connection, and establishes a command link. When the data needs to be transferred, the server tells the client on the command link with the PASV command: "I opened the ***x port and you came over to connect me." The client then sends a connection request to the server's ***x port and establishes a data link to transmit the data.
Because my local FTP server is in the network, just mapped two ports from the external network (20,21), so the PASV method can not be used, the solution to this problem is very simple, the PASV way to turn off the client, forcing it to access the server port mode, After logging in to the FTP server, use the passive command to turn off the client's PASV mode, as follows:
ftp> Passive
Passive mode off.
ftp> Passive (Run command again to open)
Passive mode on.
Come from:http://www.cnblogs.com/nssa/archive/2011/11/11/2245408.html
Workaround for "227 Entering Passive Mode" appears when FTP is connected