← Lessons

quiz vs the machine

Gold1320

Networking

FTP and SFTP Basics

Two file transfer protocols that look similar but share almost nothing.

4 min read · core · beat Gold to climb

Moving Files Across Hosts

FTP (File Transfer Protocol) is one of the oldest internet protocols. SFTP (SSH File Transfer Protocol) does the same job over a secure channel. Despite similar names, they are unrelated designs.

How FTP Works

FTP uses two connections: a control channel for commands and a separate data channel for file contents. In passive mode the server opens a data port for the client to connect to, which works better through firewalls than active mode. Classic FTP sends credentials and data in plaintext.

How SFTP Differs

SFTP is not FTP with encryption bolted on. It is a subsystem running inside an SSH session, using a single encrypted connection on port 22. Authentication, commands, and data all flow through that one secure channel.

Key idea

FTP splits commands and data across two plaintext channels, while SFTP runs as an encrypted subsystem inside a single SSH connection.

Check yourself

Answer to earn rating on the learn ladder.

1. How many connections does classic FTP use?

2. What is SFTP actually built on?