Passive transfer

In passive mode, the client initiates the connection to the server to avoid problems with firewalls. In passive mode FTP, the client opens two unprivileged ports locally (N> 1024 and N+1). The first port contacts the server on port 21, but instead of then sending a PORT command and allowing the server to connect back to its data port, the client sends the PASV command. As a result, the server opens an unprivileged port (P>1024) and sends the PORT P command back to the client. The client then initiates the connection from port N+1 to port P on the server to transfer data.