termal.in

← Blog

How to move files between two servers — without downloading them to your laptop first

· Termalin team sshscprsynctutorial

You have a 40 GB directory on server A that needs to be on server B. The reflex — download to the laptop, upload to the other box — moves the data twice, hammers your home uplink in both directions, and falls over the moment your Wi-Fi hiccups at gigabyte 32. Every admin eventually collects a better toolkit for this. Here it is, shortest path first.

1. scp -3 — the honest middleman

scp -3 -r alice@server-a:/srv/app/data bob@server-b:/srv/app/

The -3 routes traffic through your machine — A sends to you, you forward to B, nothing is written to disk. Both sides authenticate with your local keys, which is exactly why this is the zero-setup option: A and B never need to trust each other.

The cost: every byte still crosses your connection twice (in and out), and scp has no resume. Fine for config directories and dumps in the single-gigabyte range; wrong tool for the 40 GB case unless your uplink is excellent.

2. Direct copy: run it on one of the servers

The fast path is A talking straight to B over their (usually much fatter) link:

ssh alice@server-a
rsync -avP /srv/app/data bob@server-b:/srv/app/

rsync -avP gives you progress, permissions, and — the killer feature — resume: re-run the same command after any interruption and it continues where it stopped, skipping what already matches.

The catch is auth: A now needs to authenticate to B. Resist the classic shortcut of copying your private key onto A. The cleaner options, best first:

  • A dedicated key pair on A, authorized on B for exactly this job — ideally with a command= restriction in B’s authorized_keys limiting it to rsync.
  • Agent forwarding (ssh -A alice@server-a) — your local agent answers B’s challenge, no key material lands on A. Use it only toward servers you’d trust with your agent: root on A can borrow your agent socket while you’re connected.

3. The tar pipe — for minimal boxes

Appliance-grade hosts sometimes lack rsync. tar and ssh are always there:

ssh alice@server-a 'tar cf - -C /srv/app data' | ssh bob@server-b 'tar xf - -C /srv/app'

Streams through your machine like scp -3, but preserves permissions and symlinks faithfully, handles a million small files far better than per-file scp, and composes with zstd (tar cf - … | zstd / zstd -d | tar xf -) when the pipe is thin. No resume — it’s the duct-tape option, and everyone should know it anyway.

4. Object storage as the relay

When the two servers can’t reach each other and the data is big, stop streaming and stage it once in a bucket:

# on A                                   # on B
aws s3 cp data s3://my-bucket/xfer/ -r    aws s3 cp s3://my-bucket/xfer/ data -r

Both directions use each server’s own (fat) link, either side can resume, and the bucket doubles as an audit point. Works with any S3-compatible storage — MinIO on your own hardware counts. Just remember the lifecycle rule so xfer/ doesn’t quietly become a 400 GB monument to one migration.

5. The GUI way — two panes, two servers

For the everyday version of this problem — a handful of files, two servers, no ceremony — a dual-pane file manager beats all of the above on time-to-done. In Termalin, each pane connects independently: local↔host, host↔host, or an S3 bucket as either side. Drag from pane to pane and the transfer runs without staging a local copy; auth is whatever each host already uses in your client, so there’s no key-copying question at all, and no agent to expose.

It’s also the option you can hand to a teammate who would rather not learn the authorized_keys command= syntax before lunch.

Which one, when

SituationReach for
Small transfer, zero setup, untrusting serversscp -3
Big transfer, servers can talk, needs resumersync run on A
Minimal/appliance hosts, lots of small filestar-over-ssh pipe
Servers can’t reach each other, huge dataS3 relay
A few files, done in ten secondsdual-pane GUI

The theme across all five: the data should cross each network segment once, and your laptop should be a controller, not a warehouse.


Termalin’s dual-pane file manager does local↔host, host↔host and S3 transfers in the Free tier — download it, or browse the full feature list.

Try it on one host.

Termalin is a fast SSH client for you — and your agents.

Free tier · 14-day Pro trial · pricing