Cloud VPS from $1.98/mo · pay with Bitcoin, Ethereum, Monero, USDT or Solana · paid in crypto
Networking

FTP vs FTPS vs SFTP: which file transfer protocol to use

FTP, FTPS and SFTP compared: how each works, ports and firewall needs, what still demands plain FTP, and a plan to move people and scripts over to SFTP.

CloudSat teamNovember 18, 20266 min read
Abstract illustration of three file icons traveling toward a server on separate paths, one open, one sealed, one inside a glowing tube
On this pageThree protocols with similar names

FTP is one of the oldest protocols still in daily use. Hosting panels list FTP accounts, office scanners send to FTP, and partners still ask for "the FTP details". The name now covers three different things: plain FTP, FTP wrapped in TLS, called FTPS, and SFTP, which is not FTP at all but part of SSH. Choosing between them depends mostly on what the other side supports. This guide explains what each one does, which to use by default, and how to move people and scripts off plain FTP.

Three protocols with similar names

FTP

FTP was defined in its current form in RFC 959 in 1985. A client opens a control connection to TCP port 21, then every directory listing and every file travels over a separate data connection, opened in active or passive mode, as explained in how active and passive FTP work. Nothing is encrypted: user name, password, commands and files cross the network as readable data.

FTPS

FTPS is FTP with TLS added. In explicit mode the client connects to port 21 and asks to upgrade the session with the AUTH TLS command, the form standardized in RFC 4217. In implicit mode, an older convention, TLS starts from the first byte on port 990. The two-connection design stays, and the data channel must be protected too. Because the control channel is encrypted, firewalls and NAT devices can no longer read it to open data ports on the fly, so a fixed passive port range has to be opened by hand.

SFTP

SFTP, the SSH File Transfer Protocol, runs inside an SSH session on port 22. One connection carries everything, encrypted, with the same accounts, keys and host key checks as SSH logins. Despite the name, it shares nothing with FTP's command set.

Side by side

FTP FTPS SFTP
Runs over Plain TCP TCP with TLS SSH
Ports 21 plus data ports 21 (explicit) or 990 (implicit), plus a passive range 22 only
Logins encrypted No Yes Yes
Files encrypted No Yes, when the data channel is protected Yes
Server identity Not checked TLS certificate SSH host key
Key-based login No Client certificates, rarely used SSH keys, common
Firewalls and NAT Awkward Hardest: helpers cannot read the session Simple
Common servers vsftpd, ProFTPD, Pure-FTPd, IIS The same, with TLS enabled OpenSSH, SFTPGo

Graphical clients such as FileZilla, WinSCP and Cyberduck speak all three, and so do command-line tools such as lftp and curl. Web browsers dropped FTP support in 2021, so ftp:// links no longer open in Chrome or Firefox.

Which one to use

  • SFTP by default. Uploads to a web server, backups, automation, anything between machines you run. If a server already accepts SSH, SFTP needs nothing new.
  • FTPS when the other side requires the FTP family. Some business-to-business platforms and older appliances only speak FTP and FTPS. Require TLS for logins and data, and validate the certificate.
  • Plain FTP only on an isolated network, for devices that cannot do anything else. Never across the internet.

Two neighbors are worth knowing. For copying whole directory trees between servers you run, rsync over SSH beats all three, because repeated runs only send what changed. For sharing files with people who do not want a file transfer client at all, a web file share such as Nextcloud over HTTPS is easier to support than any of these protocols.

Where plain FTP still hides

  • Scanners and multifunction printers with a "scan to FTP" option.
  • IP cameras and video recorders that upload snapshots.
  • Hosting control panels that create an FTP account for every site by default.
  • Old scripts and cron jobs that call ftp or curl ftp:// with a password in the file.
  • WordPress, which shows its "Connection Information" form asking for FTP details when it cannot write to its own files. The fix is file ownership, not an FTP server: make the directories WordPress must update writable by the PHP user, and add define( 'FS_METHOD', 'direct' ); to wp-config.php.

Find FTP on your own servers

Look for listeners and for the services behind them:

sudo ss -tlnp | grep -E ':(21|990)\b'
systemctl list-units --type=service | grep -i -E 'ftp|proftpd'

Then check whether your server lets anyone log in without encryption. The first command shows whether it offers explicit TLS. The second insists on TLS: if it fails where a plain login works, unencrypted logins are still allowed.

openssl s_client -connect ftp.example.com:21 -starttls ftp </dev/null 2>/dev/null | head -5
curl --ssl-reqd --list-only -u alice ftp://ftp.example.com/

In vsftpd, force_local_logins_ssl=YES and force_local_data_ssl=YES close that gap; the passive mode guide shows them in a working configuration. On Windows, the IIS settings are covered in secure FTP with IIS and FTPS.

Move people and scripts to SFTP

1. Know who uses FTP

Read the FTP server's logs, often /var/log/vsftpd.log or /var/log/xferlog, for the accounts and source addresses seen in the last few months. Every account goes into one of three groups: people, devices or scripts. An account nobody claims is a finding in itself.

2. Give everyone SFTP access

People get an SSH account restricted to file transfer. OpenSSH confines an account to one directory with ChrootDirectory and ForceCommand internal-sftp in a Match block of sshd_config, so the user sees the same folder as before and gets no shell. Send each person the new settings: protocol SFTP, port 22, the server name and the host key fingerprint to expect on first connection.

3. Convert the scripts

Scheduled uploads become shorter once they use a key instead of a password in the script:

# before: plain FTP, password in the script
curl -T report.csv ftp://ftp.example.com/inbox/ --user batch:secret

# after: SFTP in batch mode with a dedicated key
sftp -i ~/.ssh/batch_ed25519 -b - batch@files.example.com <<'EOF'
put report.csv inbox/
EOF

Batch mode with -b never prompts, so it needs key authentication, and it stops at the first failed command, which makes failures visible in cron mail or job logs.

4. Run both, then close FTP

Leave FTP running for a few weeks and watch its log. When it stays quiet, stop and disable the service, uninstall it, and delete the firewall rules for port 21 and the passive range. On CloudSat that means removing those rows from the server's cloud firewall as well as from the firewall inside the server.

5. Fence in the devices that cannot change

Scanners and cameras that only speak FTP can upload to a small FTP drop on an internal network segment, never on a public address. A scheduled job on that machine then forwards the files over SFTP. The plain-text hop stays inside a network you control.

FAQ

Is SFTP the same as FTPS?

No. FTPS is FTP with TLS, using FTP's commands and its separate data connections. SFTP is a subsystem of SSH that runs over one connection on port 22. Clients often support both, which is why the two get confused.

Is FTPS secure enough?

Yes, when TLS is required for both logins and data and the client validates the certificate. Its weaknesses are operational: passive port ranges, firewall rules and clients that quietly fall back to plain FTP when TLS is optional.

No. Chrome and Firefox both removed FTP support in 2021. Publish downloads over HTTPS instead, and give people who need to upload an SFTP account.

Do I need an FTP server to run WordPress?

No. WordPress updates itself directly when the PHP user can write to its files. Use SFTP or SSH for your own changes to themes and configuration.

Run it on CloudSat. Cloud VPS on AMD EPYC and NVMe from $1.98/mo in 13 regions, delivered in under 5 minutes and paid in crypto. See plans or deploy a server.