← All one-liners·#073·Network & Transfer·self contained·power

Send a file securely via croc relay

Securely transfer a file to any remote machine bypassing NAT using a custom code phrase and the croc relay network.

Setup
  • → Install croc (e.g., `brew install croc` or via your system's package manager)
Cost per run
Free
The one-liner
$ croc send --code "super-secret-phrase" ./payload.tar.gz
What each stage does
  1. [01] croccroc
    Invokes the croc file transfer utility, which uses relay servers to easily bypass NAT and firewalls.
  2. [02] crocsend
    Instructs croc to act as the sender in the peer-to-peer transfer.
  3. [03] croc--code "super-secret-phrase"
    Defines a custom, pre-shared secret phrase instead of relying on an auto-generated one.
  4. [04] croc./payload.tar.gz
    The target file to be encrypted (using PAKE) and sent across the relay.
Expected output (sample)
Sending 'payload.tar.gz' (14.2 MB)
Code is: super-secret-phrase
On the other computer run

croc super-secret-phrase
Caveats & tips
  • Footgun: If the custom code phrase is too simple or easily guessable, a third party could intercept the transfer before the intended recipient connects.
  • Permission/Cost: Uses the public croc relay by default; for highly sensitive enterprise data, consider hosting your own private relay server.