Active mode and passive mode of FTP, which one should you use?

FTP file transfer is divided into two modes, active (PORT) mode and passive (Passive) mode, which one should users use?

Simple and rude, go directly to the answer

1) If it is not necessary, do not use FTP service, active/passive mode, command/data port, beginners are easy to be fooled all at once. Refer to 2 reasons why it is not recommended to use ftp on cloud hosts
2) If you must use FTP service, in today's Internet environment, use FTP passive mode for connection transmission. Don't use active mode unless you really know what you're doing.
If you just want to know the answer, you can see it here. Friends who are interested in technology and principles, please continue to the next.

FTP two-mode protocol process and principle

passive mode

screenshot
As can be seen from the above figure, the passive mode is that the FTP server returns the port required for data transmission, and the FTP client connects to the FTP server.
In most Internet applications (such as Web/Http), the client initiates a connection to the server. In other words, the vast majority of Internet applications are in passive mode. I have a few Alibaba Cloud lucky coupons to share with you. There will be special surprises for purchasing or upgrading Alibaba Cloud products with the coupons! Take all the lucky coupons for the products you want to buy! Hurry up, it's about to be sold out.

Active mode

screenshot
As can be seen from the above figure, the active mode is the port required by the FTP client to send data to the FTP server, and the FTP server connects to the port of the FTP client, which is just the opposite of the passive mode.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325273643&siteId=291194637