File transfer protocols compared: FTP, FTPS, SFTP, SCP, TFTP and SMB
In short: FTP is old and sends passwords in plain text, and its separate data connection causes firewall headaches. FTPS adds TLS to FTP, while SFTP and SCP run over SSH on port 22 and are the usual secure choice. TFTP is a tiny, unauthenticated protocol still used to boot devices and copy network images. SMB is the Windows file-sharing protocol.
The protocols
- FTP (File Transfer Protocol): uses TCP 21 for commands and a separate connection for data. Usernames, passwords and files travel unencrypted. Avoid it on untrusted networks.
- FTPS: FTP with TLS encryption, either explicit (STARTTLS on port 21) or implicit (port 990). Secure, but keeps FTP's awkward data connections.
- SFTP (SSH File Transfer Protocol): a completely different protocol that runs inside SSH on port 22. One connection, encrypted, supports keys and resume. The usual choice for servers.
- SCP: simple "secure copy" over SSH. Newer OpenSSH versions use SFTP underneath when you type scp.
- TFTP (Trivial FTP): UDP port 69, no login, no encryption, no directory listing. Tiny enough to fit in boot ROMs, so still used for PXE network booting, IP phones and copying network device images on trusted management networks.
- SMB: Windows file sharing on TCP 445. Use SMB 3 with encryption and signing; disable SMBv1, which was exploited by WannaCry.
Why FTP and firewalls do not get on
FTP opens a second connection for each file or directory listing:
- Active mode: the server connects back to the client on a port the client chose. Client-side firewalls and NAT block this.
- Passive mode: the client connects to a second port the server opens. The server's firewall must allow a range of high ports, and the server must advertise its public address if behind NAT.
Firewalls use an FTP helper (inspection) to open the right ports automatically, which does not work with FTPS because the commands are encrypted. SFTP avoids the whole problem with a single connection.
Network engineers and file transfer
Copying images and configurations to and from routers and switches is a daily task:
! From a TFTP server (trusted management network only)
copy tftp://10.10.5.20/cat9k_iosxe.17.12.04.SPA.bin flash:
! Securely over SCP
ip scp server enable
copy scp://[email protected]/backups/core1.cfg flash:core1.cfg
! Or pull from the device with scp on a Linux host
scp [email protected]:running-config ./core1-running.cfg
For large images over slow links, HTTPS and SCP are often faster and more reliable than TFTP, which sends one small block at a time and waits for each acknowledgement.
Which should you use?
- Transferring files with people or systems outside your organisation: SFTP or HTTPS-based file sharing.
- Network device images and backups: SCP or SFTP; TFTP only on an isolated management network.
- Windows file shares inside the network: SMB 3 with signing.
- Plain FTP: only for legacy systems that cannot do anything else, and never across the internet.
Real-world example: the partner upload that failed after a firewall change
A company's suppliers uploaded orders to an FTP server. After the firewall was replaced, logins worked but every directory listing hung. The new firewall had no FTP inspection enabled and only port 21 open, so passive data connections were blocked. Rather than open a range of ports, the company moved suppliers to SFTP on port 22 over the following month.
Practice
Which port does SFTP use?
Why does FTP cause problems with firewalls?
Why is TFTP still used despite having no security?
Key takeaways
- FTP is unencrypted and needs a second data connection.
- SFTP and SCP run over SSH on port 22 and are the secure default.
- TFTP (UDP 69) has no login; keep it on trusted networks.
- Use SMB 3 with signing for Windows shares and disable SMBv1.
Original content written by Mohamed Fayas for FM TecHub. © 2026 FM TecHub. You're welcome to share a link to this page; please don't copy the text elsewhere without permission.