The Correct FTP Port for Each Protocol

One often overlooked element when using file transfer protocol is the FTP port. Your client software may automatically connect via the correct ports based on the protocol chosen.

Successful file transfers can only happen when the correct ports are open.

What Are Ports?

To connect to a specific server, you need to know that server’s IP address. While that IP address identifies a particular server, ports are numbers that are used at a lower level to specify what application or service on the server you are trying to communicate with.

IP addresses are unique on the internet to the one server they are assigned to, but ports are a fixed range of numbers from 0 to 65535 that each server uses.

How Are Ports Used With File Transfer Protocols?

When a file transfer client makes a connection to a port that a file transfer service is listening on, they can then exchange information. Initially, this is in the form of commands. Commands establish the connection details and operations your want performed. The next step involves transferring the file data requested over the same or a similarly established connection.

What Ports Are Used for FTP Connections?

Are Other FTP Ports Used for Connections?

FTP has been officially assigned ports 20 and 21. If specifically using an “active” connection setting, this means that while a client computer makes the connection request and sends the commands first on port 21, known as the “control port,” a connection to the server on port 20, the “data port,” is also automatically opened to transfer the file data.

If using a “passive” FTP connection setting, the client computer also connects to the server on FTP port 21. However, the server responds with a random port number, in a free range of ports, to use for the data port for file transfers.

For example, your FTP client will open a control channel on port 21 and a data channel on a random high port in the 60000–65535 port range.

Implicit FTPS uses different ports by default, starting with assigned FTPS port 990 to make the control connection. This initiates an SSL/TLS handshake, then a connection to port 989 is made to transfer the encrypted file data.

SFTP Is Different

Why Is SFTP Implemented So Differently?

No matter what protocol you are using, the FTP port or other ports opened ensure that you are making the desired connection and that your data transfers efficiently between endpoints.