Operations 6 min read

Secure Fast Peer-to-Peer File Transfer with Croc: Install, Use, and Customize

This article introduces the Croc tool for quick, secure, and simple peer-to-peer file transfers, outlines its key features, provides step‑by‑step installation commands for multiple platforms, demonstrates usage with code examples, and explains how to run your own relay server for full control.

Open Source Linux
Open Source Linux
Open Source Linux
Secure Fast Peer-to-Peer File Transfer with Croc: Install, Use, and Customize

Transferring files between two computers can be done with many methods such as FTP or SSH, but they often require complex setup. Croc, a Go‑based utility, offers a simple, secure, and fast solution for point‑to‑point file transfer.

Features and Advantages

Uses a relay to enable any two computers to exchange files

End‑to‑end encryption with PAKE

Cross‑platform support (Windows, Linux, macOS)

Can send multiple files or entire directories

Supports resumable transfers

No need to set up your own server or use port‑forwarding

Prefers IPv6, falls back to IPv4

Can work through a SOCKS5 proxy

Installation

Download the latest version for your system and install via the command line: $ curl https://getcroc.schollz.com | bash On macOS you can also install with Homebrew:

$ brew install croc

Usage

One sender and one receiver are required. The diagram below illustrates the setup:

Diagram of sender and receiver
Diagram of sender and receiver

Send a file with a single command:

$ croc send ~/Downloads/data.csv
Sending 'data.csv' (632.9 kB)
Code is: cabinet-rodeo-mayday
On the other computer run:

croc cabinet-rodeo-mayday

The receiver runs the generated code to accept the file:

$ croc cabinet-rodeo-mayday
Accept 'data.csv' (632.9 kB)? (y/n) y
Receiving (<-111.243.108.9:51032)

You can also specify a custom secret code:

$ croc send --code appleboy ~/Downloads/data.csv

Running Your Own Relay Server

Croc uses a default relay server (croc.schollz.com). To deploy a private relay, run:

$ croc relay
[info] 2021/02/16 11:38:59 starting croc relay version v8.6.7-05640cd
[info] 2021/02/16 11:38:59 starting TCP server on 9010
[info] 2021/02/16 11:38:59 starting TCP server on 9012
[info] 2021/02/16 11:38:59 starting TCP server on 9009
[info] 2021/02/16 11:38:59 starting TCP server on 9013
[info] 2021/02/16 11:38:59 starting TCP server on 9011

You can bind the relay to a specific port:

$ croc relay --ports 3001
[info] 2021/02/16 11:39:22 starting croc relay version v8.6.7-05640cd
[info] 2021/02/16 11:39:22 starting TCP server on 3001

When transferring files, point Croc to your custom relay:

$ croc --relay 127.0.0.1:3001 send ~/Downloads/data.csv
Sending 'data.csv' (632.9 kB)
Code is: saddle-origin-horizon
On the other computer run:

croc --relay 127.0.0.1:3001 saddle-origin-horizon

Conclusion

Croc emphasizes three core strengths: simple , secure , and fast . It enables effortless peer‑to‑peer file transfers across any platform with a single command, making it a practical alternative to traditional FTP or SCP solutions.

Original source: https://blog.wu-boy.com/2021/02/share-files-between-two-computer-using-croc-tool/
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.

command-linefile transferpeer-to-peercrocrelay server
Open Source Linux
Written by

Open Source Linux

Focused on sharing Linux/Unix content, covering fundamentals, system development, network programming, automation/operations, cloud computing, and related professional knowledge.

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.