In FTP passive mode, the server opens limited ports, and the ftp server

Source: Internet
Author: User

In FTP passive mode, the server opens limited ports, and the ftp server

Many servers have established FTP services. FTP services have two connection modes: Active Mode and passive mode. For details about the two modes, refer to this article: Review the active and passive modes of FTP.

For the comparison between the two modes, the original article has the following description:

The differences between active and passive modes are as follows: when data is transmitted in active mode, the port connecting the server to the client is used; in passive mode, data transmission is the port on which the client connects to the server.

In active mode, the client must open the port to the server. Many clients are in the firewall and it is difficult to open the port to the FTP server.

In passive mode, you only need to open the port on the server to connect to the client.

As mentioned in many articles on the internet, passive connection is required, and random ports must be opened on servers. However, for security purposes, random ports are not allowed on servers, can we only open limited ports?

Let's take a look at the schematic diagram of the passive mode:

We can see which ports the Server opens are generated in steps 4th and 5th, so here we only need to make the server open a fixed (or limited) port.

I am a server built with vsftpd. In the vsftpd configuration, the configuration for enabling passive connections is as follows:

Open xxx/vsftpd. conf and add:

Pasv_enable = YES // enable PASV mode pasv_min_port = 40000 // minimum port number pasv_max_port = 40000 // maximum port number pasv_promiscuous = YES

Here, you only need to set the minimum port number and the maximum port number to the same, it becomes open fixed port (also open iptables ).

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.