Fundamentals 5 min read

Mastering FTP, TFTP, and SFTP: When and How to Use Each File Transfer Protocol

This article explains the fundamentals, connection mechanisms, transfer modes, and security differences of FTP, TFTP, and SFTP, helping readers choose the appropriate protocol for their file transfer needs.

Open Source Linux
Open Source Linux
Open Source Linux
Mastering FTP, TFTP, and SFTP: When and How to Use Each File Transfer Protocol

FTP (File Transfer Protocol) provides a reliable way to upload and download files between a client and a server using TCP. It uses two connections: a control connection on port 21 that remains open for the session, and a data connection (port 20 in active mode or a random port in passive mode) for transferring files, directory listings, etc.

FTP supports authentication, directory listing, and two transfer modes: ASCII for text files (converting characters to ASCII) and binary for images and program files (no conversion).

Active mode (PORT) – the client sends a PORT command with its temporary port; the server initiates a data connection from its port 20 to the client’s port.

Passive mode (PASV) – the client sends PASV, the server opens a temporary port and informs the client; the client then connects to that port for data transfer.

FTP active mode diagram
FTP active mode diagram
FTP passive mode diagram
FTP passive mode diagram

TFTP (Trivial File Transfer Protocol) is a simple, UDP‑based protocol (port 69) for transferring files without authentication, directory listings, or complex interactions. It is suitable for environments where only basic upload/download is needed.

TFTP encapsulation diagram
TFTP encapsulation diagram

SFTP (Secure File Transfer Protocol) runs over SSH (default port 22) and provides encrypted, authenticated file transfer. It offers higher security than FTP but incurs lower performance due to encryption overhead.

SFTP architecture diagram
SFTP architecture diagram

Understanding the differences between these protocols helps you choose the appropriate method for your security, performance, and network requirements.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Network Protocolsfile transferSFTPFTPTFTP
Open Source Linux
Written by

Open Source Linux

Focused on sharing Linux/Unix content, covering fundamentals, system development, network programming, automation/operations, cloud computing, and related professional knowledge.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.