

You can check your ephemeral port range using this command: $ cat /proc/sys/net/ipv4/ip_local_port_range The client connects from a random ephemeral source port to the FTP control port 21. When the FTP client starts a transfer, there is an option on your FTP client that controls whether you want to use active or passive FTP connection. Passive connections initiated by the client to the remote server, and the server waits for requests. When you transfer a file, the data connection starts.Īctive connections are initiated by the remote server, and the client waits for server requests. When you establish an FTP connection, the TCP port 21 opens to send your login credentials this connection is called control connection. Control connection also called a command connection.There are two types of FTP connections you can initiate:

To send or receive files from an FTP server, you can use FTP commands these commands are executed consecutively. FTP server works with the client-server architecture to communicate and transfer files.įTP is a stateful protocol, which means connections between clients and servers stay open during an FTP session.
