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.