A partner's onboarding guide says "upload with SCP". Your server only exposes SFTP. Someone on your team insists SCP is faster, someone else says it is deprecated, and both commands use the same SSH key on port 22. So which one should you actually standardize on? This post compares SCP vs SFTP on the points that matter in production: security, resumability, scripting, speed and server compatibility.
The short answer: use SFTP for anything automated or long-lived, and treat scp as a convenient command name rather than a protocol choice. The longer answer explains why, and why modern scp is quietly SFTP underneath.
Two protocols that share a transport
Both SCP and SFTP run inside an SSH connection. They use the same authentication (keys or passwords, depending on the server), the same encryption and the same port. On the wire, an observer sees an SSH session either way. The difference is what happens inside that encrypted channel.
- SCP (Secure Copy Protocol) - A descendant of the old BSD
rcpcommand. The client runsscp -torscp -fas a remote command on the server, and the two sides stream file data with a minimal header (permissions, size, name). There is no formal specification. The protocol is defined by what OpenSSH's implementation does. - SFTP (SSH File Transfer Protocol) - A proper request and response protocol running as an SSH subsystem. The client sends numbered requests (open, read, write, stat, readdir, rename, remove) and the server answers each one. It was specified in IETF drafts (OpenSSH implements version 3), and it is the basis of nearly every managed file transfer platform. See What Is SFTP? for the fundamentals.
That design difference explains almost everything else in this comparison. SCP is a one-shot copy stream. SFTP is a remote filesystem protocol.
SCP vs SFTP: a feature comparison
| Capability | SCP (legacy protocol) | SFTP |
| --- | --- | --- |
| Encryption and authentication | SSH | SSH |
| Default port | 22 | 22 |
| List remote directories | No | Yes |
| Rename, delete, create directories | No | Yes |
| Resume an interrupted transfer | No | Yes (reget, reput, get -a) |
| Interactive session | No | Yes |
| Batch scripting | One command per copy | sftp -b batch files |
| Needs a remote shell | Yes | No (runs as a subsystem) |
| Works in a chroot with internal-sftp | No | Yes |
| Formal specification | None | IETF drafts |
| Library support (Python, Go, Java) | Limited | Broad |
The rows that bite in practice are resume, directory listing and the remote shell requirement.
Resume and large files
If a 20 GB export drops at 90% over legacy SCP, you start again from zero. SFTP can seek to an offset, so the OpenSSH client can pick up where it left off:
sftp partner@files.example.com
sftp> reget exports/2026-11-18.tar.gz
sftp> reput backups/db-dump.sql.gz /incoming/db-dump.sql.gz
For nightly jobs over unreliable links, that alone settles the question.
Seeing what is on the other side
SCP has no way to ask "what files are waiting for me?" You need to know the exact remote path in advance, or open a separate SSH shell to run ls, which many file transfer servers do not allow. SFTP can list, stat and filter files in the same session that downloads them, which is what a polling script needs.
Security: why OpenSSH deprecated the SCP protocol
Because both protocols share SSH's encryption, people often assume they are equally secure. The transport is equal. The protocol logic is not.
Legacy SCP passes the remote path to a shell on the server. That means filenames are subject to shell expansion and quoting rules on the remote side. It also means the client historically trusted the server to send back only the files it asked for. CVE-2019-6111 showed that a malicious or compromised server could send files with different names than requested and overwrite files in the client's target directory. OpenSSH added checks, but the release notes for OpenSSH 8.0 stated plainly that the SCP protocol is "outdated, inflexible and not readily fixed" and recommended SFTP or rsync instead.
SFTP avoids these problems by design. Paths are sent as data inside structured requests, not interpreted by a shell, and the client decides which file handle it is reading from.
There is a second security angle that matters to server operators. To accept legacy SCP, the server must let the user execute a remote command. A hardened SFTP server typically does the opposite: it sets ForceCommand internal-sftp, chroots the user and grants no shell at all. That is one of the core recommendations in Best Practices for Securing an SFTP Server. Supporting legacy SCP pulls in the other direction.
OpenSSH 9: the scp command now speaks SFTP
Here is the part that confuses most comparisons you will find online. Since OpenSSH 9.0 (released in April 2022), the scp command uses the SFTP protocol by default. The familiar syntax stays the same:
scp report.csv partner@files.example.com:/incoming/
But under the hood, the client opens an SFTP subsystem session, not a remote scp -t command. If you need the old behavior to talk to a server without SFTP, you pass -O:
scp -O report.csv legacy-host:/data/
What this means in practice:
- Modern clients against SFTP-only servers -
scpusually just works, because it is SFTP on the wire. That includes chrooted servers with no shell. - Old clients or
-Oagainst SFTP-only servers - Fails, typically with a cryptic error such asscp: Connection closedor a message about the remote command not being allowed. - Shell quoting changes - In SFTP mode, remote paths are no longer expanded by a remote shell. Scripts that relied on remote wildcards or shell tricks in paths may behave differently. Simple globs still work, but anything clever with backticks or variables will not.
- The
scpname survives - Teams can keep their muscle memory. The protocol debate is mostly settled by the client version.
To check which client you have, run ssh -V. Anything at 9.0 or later defaults to SFTP mode.
Is SCP faster than SFTP?
This claim comes from a real history. Legacy SCP streams the whole file in one direction with no per-block acknowledgments, while early SFTP clients sent one read request, waited for the reply, then sent the next. On a high-latency link, that wait added up.
Modern SFTP clients pipeline requests. OpenSSH's sftp keeps 64 requests in flight by default (adjustable with -R) and lets you raise the buffer size with -B. With pipelining, the throughput gap on most links is small enough that disk speed, cipher choice and network conditions matter more than the protocol.
Where you still see differences:
- Thousands of tiny files - Per-file overhead dominates both protocols. Archive first (
tar czf) and transfer one file. - Very high latency links - Tune
-Rand-Bonsftpbefore blaming the protocol. Our SFTP performance optimization guide covers cipher selection and parallelism in more depth. - CPU-bound hosts - The SSH cipher costs the same for both. Choosing
aes128-gcm@openssh.comorchacha20-poly1305@openssh.comhelps either way.
If raw speed is the deciding factor, measure it on your own link. Do not choose a protocol on a benchmark from 2012.
Scripting and automation
For a quick one-off copy between two servers you control, scp is fine and pleasantly short. For anything that runs on a schedule, SFTP gives you more control.
A batch file lets you run several operations atomically from a cron job, and sftp exits non-zero if any command fails:
cat > upload.batch <<'EOF'
cd /incoming
put orders-2026-11-19.csv orders-2026-11-19.csv.part
rename orders-2026-11-19.csv.part orders-2026-11-19.csv
EOF
sftp -b upload.batch -i ~/.ssh/partner_ed25519 partner@files.example.com
The upload-then-rename pattern is impossible with SCP alone, and it matters: it stops the receiving side from picking up a half-written file. SCP has no rename.
Programming libraries follow the same split. Paramiko, AsyncSSH, Go's pkg/sftp and Apache MINA SSHD all expose rich SFTP clients, while SCP support tends to be thin or missing. If you are writing automation in Python, the Python SFTP automation guide is a good starting point.
When SCP still makes sense
SCP is not useless. It is just narrow. Reasonable cases:
- Ad hoc copies between your own Linux hosts - Where you have shell access anyway and just need a file from A to B.
- Minimal or embedded systems - Some appliances and older network devices only implement SCP for firmware or config uploads. Use
scp -Oand isolate the account. - Muscle memory with a modern client - If your client is OpenSSH 9 or later, typing
scpis effectively using SFTP, so there is little reason to retrain people.
For partner exchange, regulated data, scheduled jobs or anything that needs an audit trail, standardize on SFTP.
Common pitfalls
- Assuming
scpfailures mean bad credentials - Against an SFTP-only server,scp -Ofails after a successful login. Check the client version and drop-Obefore rotating keys. - Relying on remote shell expansion - Scripts with
scp host:'$HOME/*.log' .behave differently in SFTP mode. Use explicit paths. - Port flag confusion - Both
scpandsftpuse capital-Pfor the port.sshuses lowercase-p. Lowercase-pinscppreserves timestamps instead. - No partial-file protection - Neither protocol is atomic by itself. Upload to a temporary name and rename on SFTP, or have the receiver validate size or checksum before processing.
- Leaving shells enabled for SCP - If you only need file transfer, do not grant shell access just so legacy SCP works. Upgrade the client instead.
How FilePulse fits
FilePulse is a fully managed, EU-hosted file transfer service that accepts both SFTP and SCP, alongside FTPS, WebDAV, an S3-compatible API and a REST API. SFTP logins use public keys only, with no password login. Files can land in built-in FilePulse storage or your own S3-compatible bucket, and workflows can trigger on arrival to validate checksums or file types, route files and send signed webhooks, with every action recorded in a tamper-evident, hash-chained audit log. You do not run or patch an SSH server yourself.
Whichever command your partners type, the decision that matters is the protocol underneath. Pick SFTP for anything that runs unattended, and let scp remain a handy alias for quick copies.
Next step: Start a 14-day free trial of FilePulse, no credit card required, and test both scp and sftp uploads against your own endpoint.


