Illegal PORT command problem (FTP primary passive mode)

Source: Internet
Author: User
Tags ftp client file transfer protocol ftp protocol


When the Windows DOS window is connected with the FTP command, you can log in, but when using commands such as LS, it appears:
Illegal PORT command.
425 use PORT or PASV first.
Depending on the hint, the problem is passive mode.
the principle of FTP master/passive mode
-----------------------------------------------------------------------------------------------
FTP is an abbreviation for file Transfer Protocol, which is used to transfer files to and from one another between two computers. Much more complex than the HTTP,FTP protocol. The reason for this is that the FTP protocol uses two TCP connections, one is a command link to pass commands between the FTP client and the server, and the other is the data link, which is used to upload or download data.
The FTP protocol works in two ways: Port mode and PASV mode, Chinese meaning active and passive.
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 XXXX port and you came over to connect me." The server then sends a connection request from Port 20 to the client's XXXX 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 XXXX port and you came over to connect me." The client then sends a connection request to the server's XXXX port and establishes a data link to transmit the data.
Summarized:
--------------------------------------------------------------------------------
Active mode: The server knocks at the client and then the client opens
Passive mode: The client knocks at the server and the server opens
Therefore, if you are through the agent to the Internet, you can not use the active mode, because the server is knocking on the Internet proxy server door, rather than knocking on the client door
And sometimes, the client is not easy to open the door, because there is a firewall blocking, unless the client open more than 1024 high-end port
--------------------------------------------------------------------------------
To use the active mode to download, please download the passive mode of the tool (PASV) do not tick, active mode to download the OK, if in error, then passively actively convert to each other


---------------------------------------------------------------------------------



How to set the active and passive mode for VSFTPD:



VSFTPD configuration file/etc/vsftpd/vsftpd.conf?
Active mode settings
Port_enable=yes Open Active mode (default:yes)
Connect_from_port_20=yes when active mode is turned on? Enable default 20-port snooping
ftp_date_port=%portnumber% previous option using the No parameter is? Specify the data transfer port?
Passive mode
Pasv_enable=yes Turn on Passive mode
pasv_min_port=%number% Passive mode minimum port
pasv_max_port=%number% Passive Mode maximum port



--------------------------------------------------------------------------- -------



Most FTP clients use the PASV method by default, and the PASV mode is passive mode. In most of the FTP client settings, the words are often "PASV" or "passive mode".
IE: "Using Passive FTP", advanced Internet Options, tools, and more (requires more than IE6.0).
Cuteftp:edit, Setting, Connection, Firewall, PASV Mode
or File--site Manager, on the left, select sites, Edit, "Use PASV mode"
FlashGet: "PASV mode", editor, direct connection, proxy Server, options, tools
FlashFXP: Agent/Firewall/identity--"using passive mode", option, parameter selection
or site management, corresponding site, options, use passive mode
or quick Connect, toggle, use Passive mode
Leapftp:option->preferences, General->proxy->use PASV Mode



Illegal PORT command problem (FTP primary passive mode)


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.