Active FTP vs Passive FTP: what are Active & Passive FTP modes, and their differences.



Active FTP vs Passive FTP: what are Active & Passive FTP modes, and their differences.

Active FTP vs Passive FTP: what are Active & Passive FTP modes, and their differences.

In this video, we will talk about Active and Passive FTP modes, the differences, and which one to use.

First, let’s talk about what FTP is and how it works. FTP means File Transfer Protocol. It is widely used to transfer large amount of data over the network.

The original FTP protocol transfers data without encryption. FTPS is the same FTP protocol with SSL or TLS encryption. Here we will use FTP to include both “FTP and FTPS”.

FTP uses two channels for transferring files: one is the command channel, the other is the data channel. Each channel is a TCP connection. So an FTP connection may include two TCP connections.

The command channel is used to send FTP commands and receive responses from the server. A data channel is created when it needs to send large amount of data, such as file content or directory list information.

In the Active mode, the FTP client connects to the server, sends commands and receives responses via the Command channel. When it needs to send or receive files, it sends the PORT command with the client’s IP address and a random port number. Upon receiving the PORT command, the server connects to the client at the specified IP and port to establish the data channel.

The client then sends a download or upload command via the command channel; after receiving a response from the server, the client will send or receive the data, and the server will receive or send the data, via the data channel.

In the Passive mode, when the client needs to send or receive a file, it sends the PASV command to the server. The server then sends its IP and a random port number to the client. The client connects to the IP and port to establish the data channel.

The Active mode FTP requires opening a range of ports for inbound connections. It is considered unsafe, so it is often blocked by the router or firewall in the client side. The Passive Mode FTP does not require opening any inbound ports. It is usually not blocked by client-side routers or firewalls.

So which FTP mode to use? It does not matter. You just need to check if it works. If it does not work, usually it is the active mode that is blocked by the client side router or firewall. You can change to the Passive mode.

Most FTP clients support both Active & Passive modes. Windows Command-line FTP client only supports the Active Mode . If you need a command-line FTP client that supports the passive mode, you can use DriveHQ’s CommandFTP client. It supports Passive mode FTP, FTPS and SFTP:
https://www.drivehq.com/DriveHQ-KB/ftp/Command-line_FTP_Scripting.aspx

FTP-enabled software & devices usually can support both Active & Passive modes. You might need to manually select a mode.

FTP server software usually can support both Active & Passive modes. But it is dependent on your server & firewall configuration. Active Mode FTP only requires opening port 21 on the server side. Passive Mode FTP requires opening port 21, plus a range of ports on the server side. The FTP server needs to be configured to use these ports for the data channel.

If you don’t have your own FTP server, you can use a hosted FTP service such as DriveHQ’s cloud FTP server. It supports both Active and Passive modes, and all FTP server features. You can use DriveHQ’s FTP server name, or setup a co-branded FTP server name. You don’t need to worry about firewall settings. For more information, please visit https://www.DriveHQ.com and click FTP SFTP Hosting:
https://www.drivehq.com/CloudFTPServerHosting/

Comments are closed.