Operations 9 min read

Secure Cross‑Platform File Transfer Made Easy with Croc

This guide explains how to install the open‑source Croc tool on Linux and other platforms, use its relay‑based, PAKE‑encrypted protocol to transfer files, folders, or text securely, customize code phrases, pipe data, set output directories, and access full command‑line help.

ITPUB
ITPUB
ITPUB
Secure Cross‑Platform File Transfer Made Easy with Croc

Installing Croc on Linux

You can install Croc on any supported Linux or Unix distribution using a simple one‑liner: $ curl https://getcroc.schollz.com | bash The script downloads the binary and places it in /usr/local/bin/. If you prefer package managers, you can use gdebi with a downloaded .deb file, pacman -S croc on Arch, nix-env -i croc on NixOS, or snap install croc. With a Go environment installed, you can also compile from source:

$ GO111MODULE=on go get -v github.com/schollz/croc/v8

Transferring Files and Folders with Croc

After installing, run croc send <path> to transmit a file or directory. Croc generates a random code phrase (e.g., slow-tomato-almond) that the receiver uses to establish a PAKE‑derived encryption key:

$ croc send file.txt
Sending 'file.txt' (116 B)
Code is: slow-tomato-almond
On the other computer run

croc slow-tomato-almond

The receiver executes the displayed command, confirms with y, and the transfer proceeds with a progress bar.

Setting a Custom Code Phrase

To avoid random phrases, supply --code followed by your chosen phrase:

$ croc send --code download-this file.txt
Code is: download-this

The recipient then runs croc download-this to receive the file.

Sending Text

Croc can also share plain text or URLs using the --text flag:

$ croc send --text "Hello!!"
Code is: natural-roof-clock

The other side runs croc natural-roof-clock to display the message.

Using Pipes

You can pipe command output directly into Croc: $ cat file.txt | croc send Croc treats the piped data as a temporary file and assigns a code phrase (e.g., dexter-cowboy-soprano). The receiver runs the same code to retrieve the data, optionally using --yes to skip prompts.

Setting an Output Folder

By default, received files are saved in the current directory. Use --out <path> on the receiving side to specify a different location:

$ croc --out ~/Downloads

Getting Help

Run croc --help to see a full list of commands and global options, such as --relay, --yes, --out, and compression controls.

Key Features of Croc

Relay‑based full‑duplex communication for fast transfers

PAKE‑based end‑to‑end encryption

Multiple‑file and resume support

No central server or port‑forwarding required

IPv6‑first with IPv4 fallback

Zero dependencies, cross‑platform

Free and open‑source under the MIT license

Croc output example
Croc output example
Custom code phrase example
Custom code phrase example
Sending text example
Sending text example
Pipe transfer example
Pipe transfer example
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

cross-platformLinuxcommand-linefile transfercrocsecure transfer
ITPUB
Written by

ITPUB

Official ITPUB account sharing technical insights, community news, and exciting events.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.