Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Easily and securely send things from one computer to another 🐊 📦

License

NotificationsYou must be signed in to change notification settings

schollz/croc

Repository files navigation

croc
VersionBuild Status

This project is supported byGitHub sponsors.

About

croc is a tool that allows any two computers to simply and securely transfer files and folders. AFAIK,croc is the only CLI file-transfer tool that doesall of the following:

  • Allowsany two computers to transfer data (using a relay)
  • Providesend-to-end encryption (using PAKE)
  • Enables easycross-platform transfers (Windows, Linux, Mac)
  • Allowsmultiple file transfers
  • Allowsresuming transfers that are interrupted
  • No need for local server or port-forwarding
  • IPv6-first with IPv4 fallback
  • Canuse a proxy, like Tor

For more information aboutcroc, seemy blog post or read arecent interview I did.

Example

Install

You can downloadthe latest release for your system, or install a release from the command-line:

curl https://getcroc.schollz.com| bash

On macOS

UsingHomebrew:

brew install croc

UsingMacPorts:

sudo port selfupdatesudo port install croc

On Windows

You can install the latest release withScoop,Chocolatey, orWinget:

scoop install croc
choco install croc
winget install schollz.croc

On Unix

You can install the latest release withNix:

nix-env -i croc

On Alpine Linux

First, install dependencies:

apk add bash coreutilswget -qO- https://getcroc.schollz.com| bash

On Arch Linux

Install withpacman:

pacman -S croc

On Fedora

Install withdnf:

dnf install croc

On Gentoo

Install withportage:

emerge net-misc/croc

On Termux

Install withpkg:

pkg install croc

On FreeBSD

Install withpkg:

pkg install croc

On Linux, macOS, and Windows via Conda

You can install fromconda-forge globally withpixi:

pixi global install croc

Or install into a particular environment withconda:

conda install --channel conda-forge croc

Build from Source

If you prefer, you caninstall Go and build from source (requires Go 1.22+):

go install github.com/schollz/croc/v10@latest

On Android

There is a 3rd-party F-Droid appavailable to download.

Usage

To send a file, simply do:

$ croc send [file(s)-or-folder]Sending'file-or-folder' (X MB)Code is: code-phrase

Then, to receive the file (or folder) on another computer, run:

croc code-phrase

The code phrase is used to establish password-authenticated key agreement (PAKE) which generates a secret key for the sender and recipient to use for end-to-end encryption.

Customizations & Options

Usingcroc on Linux or macOS

On Linux and macOS, the sending and receiving process is slightly different to avoidleaking the secret via the process name. You will need to runcroc with the secret as an environment variable. For example, to receive with the secret***:

CROC_SECRET=*** croc

For single-user systems, the default behavior can be permanently enabled by running:

croc --classic

Custom Code Phrase

You can send with your own code phrase (must be more than 6 characters):

croc send --code [code-phrase] [file(s)-or-folder]

Allow Overwriting Without Prompt

To automatically overwrite files without prompting, use the--overwrite flag:

croc --yes --overwrite<code>

Excluding Folders

To exclude folders from being sent, use the--exclude flag with comma-delimited exclusions:

croc send --exclude"node_modules,.venv" [folder]

Use Pipes - stdin and stdout

You can pipe tocroc:

cat [filename]| croc send

To receive the file tostdout, you can use:

croc --yes [code-phrase]> out

Send Text

To send URLs or short text, use:

croc send --text"hello world"

Use a Proxy

You can send files via a proxy by adding--socks5:

croc --socks5"127.0.0.1:9050" send SOMEFILE

Change Encryption Curve

To choose a different elliptic curve for encryption, use the--curve flag:

croc --curve p521<codephrase>

Change Hash Algorithm

For faster hashing, use theimohash algorithm:

croc send --hash imohash SOMEFILE

Self-host Relay

You can run your own relay:

croc relay

By default, it uses TCP ports 9009-9013. You can customize the ports (e.g.,croc relay --ports 1111,1112), but at least2 ports are required.

To send files using your relay:

croc --relay"myrelay.example.com:9009" send [filename]

Self-host Relay with Docker

You can also run a relay with Docker:

docker run -d -p 9009-9013:9009-9013 -e CROC_PASS='YOURPASSWORD' schollz/croc

To send files using your custom relay:

croc --pass YOURPASSWORD --relay"myreal.example.com:9009" send [filename]

Acknowledgements

croc has evolved through many iterations, and I am thankful for the contributions! Special thanks to:

And many more!


[8]ページ先頭

©2009-2025 Movatter.jp