Operations 6 min read

Secure One‑Click File Transfer Between Two Computers Using Croc

This guide explains how to use the Go‑based Croc tool for fast, encrypted, cross‑platform file transfers between two computers without setting up a server, covering its features, command‑line usage, and how to run your own relay server.

MaGe Linux Operations
MaGe Linux Operations
MaGe Linux Operations
Secure One‑Click File Transfer Between Two Computers Using Croc

Transferring files between two computers can be done via many methods such as FTP or SSH, but they require setting up services or learning commands. This article introduces Croc, a Go‑based tool that enables fast, secure, point‑to‑point file transfer without needing a dedicated server.

Tool Features and Advantages

Uses a relay to allow any two computers to transfer files

End‑to‑end encryption using PAKE

Cross‑platform (Windows, Linux, macOS)

Supports multiple files or whole directories

Resumes interrupted 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

Usage

The workflow is illustrated below.

On the sending side run:

$ 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

On the receiving side execute the displayed code:

$ 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 The tool connects to a default relay server unless you specify another one.

// DEFAULT_RELAY is the default relay (can be set using --relay)
var (
    DEFAULT_RELAY      = "croc.schollz.com"
    DEFAULT_RELAY6     = "croc6.schollz.com"
    DEFAULT_PORT       = "9009"
    DEFAULT_PASSPHRASE = "pass123"
)

To deploy your own relay server, 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 specify a single port for the relay:

$ 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

Then use the custom relay when sending files:

$ 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 simplicity, security, and speed, making point‑to‑point file transfers easy across Windows, macOS, and Linux; a single command installs the tool, and users can quickly share files with others.

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-linefile transfercrocrelay serversecure transfer
MaGe Linux Operations
Written by

MaGe Linux Operations

Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.

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.