LinuxCommandLibrary

croc

Securely transfer files or folders

TLDR

Send a file or directory

$ croc send [path/to/file_or_directory]
copy

Send a file or directory with a specific passphrase
$ croc send [[-c|--code]] [passphrase] [path/to/file_or_directory]
copy

Receive a file or directory on receiving machine
$ croc [passphrase]
copy

Send and connect over a custom relay
$ croc --relay [ip_to_relay] send [path/to/file_or_directory]
copy

Receive and connect over a custom relay
$ croc --relay [ip_to_relay] [passphrase]
copy

Host a croc relay on the default ports
$ croc relay
copy

Display parameters and options for a croc command
$ croc [send|relay] --help
copy

SYNOPSIS

croc send|recv [options] [files|code]

PARAMETERS

--code
    Use custom 4-32 char code instead of generated one

--pass
    Protect transfer with optional password

--local
    Use localhost relay (for LAN)

--usb
    Send code via USB instead of stdout

--overdrive
    Maximize transfer speed (less secure)

--socks
    Use SOCKS5 proxy for relay connection

--port
    Relay port (default 9253)

--stdout
    Send to stdout instead of file (recv only)

--hash
    Display SHA256 hash after transfer

--progress
    Show transfer progress bar

--quiet
    Suppress non-error messages

--debug
    Enable debug logging

--help
    Show help

--version
    Show version info

DESCRIPTION

croc is a command-line tool for securely sending files, folders, or archives between computers over the internet.

It eliminates the need for port forwarding or VPNs by using a public relay server for initial key exchange via Curve25519, Noise protocol, and ChaCha20-Poly1305 encryption for end-to-end security.

Usage is simple: on the sender side, run croc send file.txt to generate a unique code (e.g., croc-4f9b3d); share this code with the receiver, who runs croc 4f9b3d (or croc recv 4f9b3d). Transfers resume if interrupted and support passwords for protection.

Features include progress bars, resumable transfers, compression, stdout piping, USB code sharing, and overdrive mode for maximum speed. Works on Linux, macOS, Windows, and supports IPv6.

CAVEATS

Requires croc installed on both endpoints and internet access for relay (unless --local). Transfers limited by relay bandwidth; large files may take time. Not for production without trusted relay.

INSTALLATION

Download binaries from GitHub releases or install via go install github.com/schollz/croc/cmd/croc@latest or package managers like brew (macOS), snap.

EXAMPLE

Sender: croc send largefile.zip
Receiver: croc abc123

HISTORY

Developed by Jack O'Connor (@schollz) starting 2019 as open-source Go project on GitHub (github.com/schollz/croc). Reached v1.0 in 2020 with major features; actively maintained with 20k+ stars.

SEE ALSO

scp(1), rsync(1), wormhole(1)

Copied to clipboard