Active and passive mode in FTP

For FTP there is two channel, data channel and command channel.

Data channel uses 20 and command channel uses 21 protocol.

What is Active mode FTP ?

1. A user connects from a random port on a file transfer client to port 21 on the server.

It sends the PORT command, specifying what client-side port the server should connect to. This port will be used later on for the data channel and is different from the port used in this step for the command channel.

2. The server connects from port 20 to the client port designated for the data channel. Once connection is established, file transfers are then made through these client and server ports.

activeftp

What is passive mode FTP ?

1. The client connects from a random port to port 21 on the server and issues the PASV command. The server replies, indicating which (random) port it has opened for data transfer.

2.The client connects from another random port to the random port specified in the server’s response. Once connection is established, data transfers are made through these client and server ports.

passive ftp

Some time users can’t connect to FTP server, it is because the client machine’s firewall is blocking the connection. We can use passive type connection for avoiding those type of issues.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s