Secure Fast File Transfers with croc: Install, Use, and Customize

This guide explains how to install the cross‑platform croc command‑line tool, use its relay‑based fast and end‑to‑end encrypted file and text transfer features, customize code phrases, handle pipes, set output folders, and access its full help options on Linux, macOS, and Windows.

Liangxu Linux
Liangxu Linux
Liangxu Linux
Secure Fast File Transfers with croc: Install, Use, and Customize

What is croc?

croc is a command‑line utility that enables fast, secure, and easy file or folder transfers between two or more computers. It creates a full‑duplex real‑time communication layer using a relay server, allowing upload and download to happen simultaneously.

Data is protected with end‑to‑end encryption provided by a PAKE (Password‑Authenticated Key Exchange) library, which generates a strong key from a shared weak password that only the sender and receiver know.

croc supports transferring multiple files in one session, resumes interrupted transfers, requires no central server or port forwarding, works on IPv6 first with IPv4 fallback, has zero dependencies, is cross‑platform, and is free and open‑source under the MIT license.

Installing croc on Linux

You can install croc on any supported Linux or Unix distribution using one of the following methods:

Run the official install script: curl https://getcroc.schollz.com | bash (downloads the binary to /usr/local/bin/).

Download a pre‑compiled .deb file and install with gdebi:

sudo apt install gdebi
sudo gdebi croc_8.3.2_Linux-64bit.deb

Install via the Arch Linux package manager: pacman -S croc Install on NixOS: nix-env -i croc Install from the Snap store: snap install croc If you have a Go environment, compile from source:

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

Transferring files and folders

After installing, ensure croc is available on all participating machines. To send a file or directory, run: croc send <path/to/file-or-folder> croc will generate a random code phrase (e.g., slow-tomato-almond) that acts as a secret. On the receiving computer, execute the same phrase: croc slow-tomato-almond Confirm the transfer by typing y when prompted. The tool will display progress and save the file in the current directory.

Custom code phrases

For repeatable transfers, specify a custom phrase with the --code flag: croc send --code download-this file.txt The receiver then runs croc download-this to retrieve the file.

Sending text

croc can also share arbitrary text or URLs: croc send --text "Hello!!" The receiver runs the displayed code (e.g., natural-roof-clock) to see the text.

Using pipelines

You can pipe any command’s output into croc: cat file.txt | croc send croc treats the piped data as a file named automatically (e.g., croc-stdin-12345 ). The receiver uses the generated code to fetch the data, optionally adding --yes to skip confirmation.

Specifying an output folder

By default, received files are saved in the current directory. Use --out to change the destination:

croc --out ~/Downloads

Getting help

Run croc --help to see a full list of commands and global options, including --relay to specify a custom relay server, --yes to auto‑accept prompts, and compression controls.

croc usage example
croc usage 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-platformcommand-lineencryptionfile transfercroc
Liangxu Linux
Written by

Liangxu Linux

Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)

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.