Command-Line File Transfer Tools Compared
By SRIFT maintainers · Published
Reviewed by SRIFT maintainers · last reviewed against the SRIFT 4.3.2 source · third-party facts checked 8 October 2026.
Short answer
The command-line tools for moving files fall into three families. scp, sftp and rsync run over SSH: strong and ubiquitous, but they need an account on the other machine and an SSH port you can reach. Magic Wormhole and croc pair two people with a short code and a PAKE key exchange, need no accounts or open ports, but need the tool on both ends. SRIFT quick-share turns a file into an HTTPS link that streams from the sender, so the recipient needs only a browser or curl.
The deciding questions are network access (who can reach whom), what the recipient has installed, and how the other side is authenticated: SSH keys, a one-time code, or a link that works for whoever holds it.
- Both machines yours, SSH reachable
- rsync or sftp
- Two people, both with a terminal
- Magic Wormhole or croc
- Recipient has only a browser
- A streamed link (SRIFT quick-share)
- scp since OpenSSH 9.0
- Uses the SFTP protocol by default
The tools at a glance
| Tool | Needs an SSH account / reachable port? | Recipient needs | Relay involved | Best fit |
|---|---|---|---|---|
| scp | Yes: account and a reachable sshd (usually TCP 22) | SSH client and account | No (direct SSH connection) | Quick copies between machines you administer |
| sftp | Yes, same as scp | SSH client and account | No | Interactive browsing, resumable single files |
| rsync over SSH | Yes, same as scp | rsync on both ends | No | Repeated syncs, large trees, changed files only |
| Magic Wormhole | No | A wormhole client | Mailbox server always; transit relay if no direct path | One-off handoff between two people |
| croc | No | croc (or its compatible browser version) | Relay; promoted to a direct path when NAT traversal succeeds | One-off handoff, resumable, self-hostable relay |
| SRIFT quick-share | No: outbound HTTPS on 443 only | A browser, curl or srift get | Always (server forwards the stream) | Handing a file to someone who has only a browser |
| Tool | Authentication | E2EE | Resume | Directories |
|---|---|---|---|---|
| scp | SSH keys or password; host key pinned in known_hosts | Yes (SSH channel between the hosts) | No | Yes, -r |
| sftp | Same as scp | Yes | Yes: reget, reput, -a | Yes, -r or get -R |
| rsync over SSH | Same as scp | Yes (via SSH) | Yes: --partial, --append-verify | Yes, -a |
| Magic Wormhole | Single-use code, SPAKE2 PAKE | Yes (NaCl secretbox, key from PAKE) | Not documented | Yes |
| croc | Code phrase, PAKE | Yes | Yes | Yes, multiple files and folders |
| SRIFT quick-share | Bearer link (unguessable token), optional password | Only with --encrypt (key in URL fragment) | HTTP ranges; srift get resumes | Yes, packed as .tar.gz |
scp, sftp and rsync: the SSH family
All three ride on an SSH connection, so they inherit its security model: the client verifies the server's host key (pinned on first use in known_hosts), the user authenticates with a key or password, and everything travels inside the encrypted SSH channel. There is no third party in the path. The cost is access: you need an account on the remote machine and a network path to its SSH port, which rules them out for handing a file to a colleague, a client or a locked-down container.
scp
The OpenSSH manual notes that since OpenSSH 9.0, scp uses the SFTP protocol for transfers by default; -O selects the legacy SCP protocol for servers without SFTP support. The command line is unchanged, but quoting and wildcard behaviour can differ slightly from the old protocol.
scp ./build.tar.gz [email protected]:/srv/releases/
scp -r [email protected]:/var/log/app ./app-logs
scp -O legacy-host:/data/file.bin . # force the old SCP protocolsftp
Interactive, and the one SSH tool with built-in resume for single files: reget and reput continue partial transfers, on the assumption that the partial copy matches the remote file.
sftp [email protected]
sftp> get -R /var/log/app ./app-logs
sftp> reget /srv/backups/db.dump # resume an interrupted downloadrsync
rsync's delta-transfer algorithm sends only the differences between source and destination, which makes it the right choice for repeated syncs and for large directory trees. --partial keeps partly transferred files, and --append-verify continues them and checks the whole file afterwards.
rsync -az --partial -e ssh ./dist/ [email protected]:/srv/app/
rsync -a --append-verify [email protected]:/srv/backups/db.dump ./Magic Wormhole: PAKE and a short code
Magic Wormhole was designed for the case SSH cannot serve: two people, no shared accounts, no open ports. The sender gets a code such as 7-crossover-clockwork, reads it out, and the receiver types it in.
Under the hood, both clients connect to a mailbox (rendezvous) server, a WebSocket relay that delivers small messages between them. They run SPAKE2, a password-authenticated key exchange, using the code as the password. PAKE is the important part: the mailbox server never learns a key it could use, and an attacker who wants in must guess the code during the exchange. The documentation puts the default code at 16 bits, so an attacker gets a 1-in-65,536 chance, one attempt per code, and a failed attempt makes the real exchange fail visibly. Codes are single-use.
The file then moves over a direct TCP connection if one can be made, or through a transit relay that joins two outbound connections (the project calls it the moral equivalent of a TURN server). Data is encrypted with NaCl secretbox under the PAKE-derived key, so the relay forwards ciphertext. Both clients must stay running until the transfer finishes.
# sender
wormhole send ./dataset.parquet
# Wormhole code is: 7-crossover-clockwork
# receiver
wormhole receive 7-crossover-clockwork
# longer code for higher-value transfers
wormhole send --code-length=3 ./dataset.parquetcroc: PAKE, relay fallback and resume
croc follows the same idea: a code phrase feeds a PAKE that produces the end-to-end encryption key. Its README describes transfers as peer to peer with a relay fallback, sends multiple files and folders in one command, and supports resuming interrupted transfers. The relay is easy to self-host (croc relay, TCP ports 9009-9013 by default), and a SOCKS5 proxy such as Tor can be set on both peers.
On Linux and macOS the receiver passes the code in the CROC_SECRET environment variable rather than as an argument, so it does not leak through the process list. Custom code phrases must be at least six characters.
# sender
croc send ./dataset.parquet ./reports/
# prints a code phrase
# receiver (Windows)
croc <code-phrase>
# receiver (Linux / macOS)
CROC_SECRET=<code-phrase> croc
# your own relay
croc relay
croc --relay "relay.example.com:9009" send ./dataset.parquetSSH keys, PAKE codes and bearer links compared
The tools differ most in how they decide that the other end is the right one, and that matters more than cipher choices.
- SSH keys authenticate both sides cryptographically and keep working for years. The weak point is the first connection, where you accept a host key, and the operational cost of distributing accounts.
- PAKE codes (Magic Wormhole, croc) are short but strong in a specific way: they can only be guessed online, during the exchange, and a wrong guess is noticed. A code that has been used, or overheard after the transfer, is worthless. Nobody in the middle, including the rendezvous server, can derive the key.
- Bearer links (SRIFT quick-share, and cloud share links in general) carry a random token too long to guess, but anyone who has the full URL can download while the link is live. Links get pasted into chat histories, ticket systems and browser history, and
--encryptkeeps the key from the server, not from whoever reads the link.
Which tool for which job
- Both machines are yours and SSH is open: rsync for anything repeated or large, sftp when you need to resume a single big file, scp for a quick copy.
- Two people with terminals, one-off: Magic Wormhole for the simplest secure handoff; croc if you want resume, several paths at once, or your own relay.
- The recipient has only a browser, or the sender is behind a firewall that allows only outbound HTTPS: a streamed link such as SRIFT quick-share, with
--encryptand a short lifetime. The firewall and proxy guide covers why outbound 443 is often the only door open. - Asynchronous delivery to someone who will download days later: none of these; use storage.
Frequently asked questions
Is scp deprecated?
The command is not going away, but since OpenSSH 9.0 it uses the SFTP protocol by default instead of the legacy SCP protocol. The -O flag forces the old protocol for servers that lack SFTP support.
Do Magic Wormhole and croc need port forwarding?
No. Both clients make outbound connections to a rendezvous or relay server and try a direct connection when the network allows it, falling back to the relay when it does not.
Can the SRIFT server read a quick-share file?
Not when the link was created with --encrypt: the key is in the URL fragment, which is never sent to the server, so the server forwards ciphertext. Without --encrypt the transfer is protected by TLS only and the server sees the file in transit. It always sees metadata such as IP addresses and the transfer size.
References
- scp(1) manual page (OpenBSD / OpenSSH)
- sftp(1) manual page (OpenBSD / OpenSSH)
- rsync(1) manual page (rsync project)
- Magic Wormhole: Welcome (Magic Wormhole)
- croc README (croc project)
- RFC 4251: The Secure Shell (SSH) Protocol Architecture (IETF)
Use SRIFT from a terminal
One command prints a download link that streams from your machine. Needs only outbound HTTPS; --encrypt keeps the key out of the relay.
npx -y srift-transfer quick-share ./build.tar.gz --encryptRelated resources
- Get Files Off a Remote Server Without Opening Inbound PortsPull logs, dumps and builds from Linux servers, cloud VMs and headless boxes when SSH is not an option: outbound-only methods and their trade-offs.How-to
- Moving Files Out of Docker Containers and Kubernetes Podsdocker cp, kubectl cp, volumes and outbound links compared for getting files out of containers and pods, including distroless and restricted clusters.How-to
- Automating Secure File Transfer: the SRIFT REST API and SDKsWhat makes a file-transfer API secure, and how to send and receive files from code with SRIFT: local REST endpoints, events and Python and Node.js SDKs.How-to
- SRIFT Security Architecture and Threat ModelHow SRIFT encrypts files, chat and quick-share links: key agreement, AES-256-GCM, what the servers see, and the attacks it does not stop.Explainer
