What does plain FTP expose to anyone on the network path, and how do FTPS and SFTP each close that gap?
answer
- nothing in FTP is encrypted
- USER and PASS as readable text
- same protocol, TLS added
- different protocol inside an SSH connection
basics
~10 sPlain FTP sends USER, PASS, every command and every file in clear text. FTPS keeps FTP and adds TLS to its connections; SFTP is a separate file protocol that runs inside an SSH connection.
solid answer
~50 sPlain FTP (RFC 959) has no encryption at all. The control connection on TCP 21 carries `USER`, `PASS`, paths and commands as readable text, and each data connection carries listings and file contents unencrypted, so anyone on the path can read the password and the files and could alter them. **FTPS** (RFC 4217) is the same FTP with TLS added: the client sends `AUTH TLS` to protect the control connection, then `PBSZ 0` and `PROT P` to protect the data connections, and the server proves who it is with an X.509 certificate. **SFTP** is not FTP at all: it is a different file-transfer protocol carried inside an SSH connection, with the server identified by its SSH host key and users authenticated by SSH keys or passwords. Moving from FTP to SFTP means a different protocol at both ends, not a setting.
go deeper
Recall that plain FTP encrypts nothing, so USER, PASS and files are readable, and that FTPS and SFTP are different protocols needing different clients.
Explain that FTPS adds TLS to FTP's own connections through AUTH TLS and PROT P, while SFTP is a separate protocol running inside one SSH connection.
Show what each option means operationally: certificates versus SSH host keys, FTP's extra data connections versus one SSH connection, and which clients the users already have.
Frame plain FTP as a credential-exposure finding and weigh whether FTPS or SFTP fits the estate's clients, partners and key management before anyone picks one.
## What plain FTP puts on the wire **FTP** (File Transfer Protocol, RFC 959) predates the habit of encrypting everything. A session uses a **control connection** to TCP port 21 for commands and replies, and opens a separate **data connection** for each file transfer or directory listing. Neither connection is encrypted, and nothing in the protocol checks that bytes were not changed in transit. A login and upload looks like this to anyone who can capture the traffic (C: is the client, S: the server): 1. S: `220` greeting when the client connects to port 21. 2. C: `USER deploy` 3. S: `331 User name okay, need password.` 4. C: `PASS` followed by the password, as plain readable characters. 5. S: `230 User logged in, proceed.` 6. A data connection opens and the file's bytes cross it exactly as stored on disk. RFC 2577, the FTP security considerations, says it directly: all data and control information, passwords included, is sent unencrypted by standard FTP. ## What that exposes - **Credentials.** The password is readable by anyone on the path: a shared network segment, a mirrored switch port, a compromised router or host along the way. Reused passwords then open other systems. - **Content.** Every uploaded or downloaded file, and every directory listing, can be read in full. - **Integrity.** Without cryptographic integrity, an attacker in the path can change a file or inject commands, and neither side can tell. - **Metadata.** File names, paths and the sequence of commands reveal what is being moved and when. A strong password policy changes none of this: a long password is as readable as a short one once it crosses the wire as text. ## FTPS: the same protocol with TLS **FTPS** keeps FTP's commands, replies and two kinds of connection and wraps them in **TLS**. In the standardised form (RFC 4217, built on the security extensions of RFC 2228), the client connects to port 21 as usual and sends `AUTH TLS`; the server answers `234 Security data exchange complete.` and both sides run a TLS handshake on that same connection. Commands sent after that, including `USER` and `PASS`, are encrypted. Data connections are a separate step: they start in the **Clear** state, and the client must send `PBSZ 0` and `PROT P` (Private) before listings and files travel inside TLS as well. The server identifies itself with an **X.509 certificate**, as a web server does; checking that certificate is the TLS client's job and is covered with the TLS material, not here. ## SFTP: a different protocol **SFTP** sounds like "secure FTP" but shares no commands, reply codes or connection model with FTP. It is a binary file-transfer protocol that runs as a subsystem of an **SSH** connection, normally on TCP 22, so authentication, encryption and integrity all come from SSH. The server is identified by its **SSH host key**, and users log in with SSH keys or passwords inside the encrypted channel. Its specification is an Internet-Draft, not an RFC; OpenSSH speaks version 3 of it. ## Side by side | | Plain FTP | FTPS | SFTP | |---|---|---|---| | Defined by | RFC 959 | RFC 4217 (on RFC 2228) | an Internet-Draft | | Transport | control on 21 plus separate data connections | the same connections, with TLS | one SSH connection | | Server identity | none | X.509 certificate | SSH host key | | Password on the wire | readable | inside TLS, if sent after `AUTH TLS` | inside SSH | | File contents | readable | inside TLS only with `PROT P` | inside SSH | | Client needed | any FTP client | an FTP client with TLS support | an SFTP client | ## Common confusions - "SFTP is FTP over SSH." It is not; it is its own protocol, and a client that speaks only FTP cannot talk to an SFTP server. - "`AUTH TLS` protects everything." It protects the control connection; without `PROT P` files still cross in clear text. - "FTPS and SFTP are interchangeable names." They need different clients, different server software and different trust material: certificates on one side, SSH keys on the other. Choosing between them for a real migration is a separate judgment about clients, partners, firewalls and keys.
- Under RFC 4217, does sending AUTH TLS alone protect the files an FTPS client transfers?No. `AUTH TLS` protects the control connection: commands, replies and any `USER` and `PASS` sent after it. RFC 4217 says data connections start in the Clear state, so the client must send `PBSZ 0` and then `PROT P` before files and listings travel inside TLS. A session that negotiates `AUTH TLS` but never sends `PROT P` still moves every file in clear text.
- If plain FTP only runs over a private link between two offices, is the clear text still a problem?Yes. A private link limits who is on the path, not what the traffic contains: anyone with access to a switch, a mirrored port or a compromised host along it still reads the password and the files, and nothing detects tampering. Security reviews flag clear-text credentials regardless of the link, and the fix is still FTPS with `PROT P` or SFTP.
- SFTP is just FTP tunnelled through SSH
- FTPS and SFTP are two names for the same protocol
- FTP clients hash the password before sending PASS
- Only the password is exposed; file contents are safe
- AUTH TLS alone also encrypts every file transfer