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.
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/v8Transferring 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-almondThe 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-thisThe 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-clockThe 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 ~/DownloadsGetting 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
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
ITPUB
Official ITPUB account sharing technical insights, community news, and exciting events.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
