Croc is a free and open-source command-line tool that allows two computers to transfer files and folders using code phrases securely.
Table of contents
- How to Install Croc Secure File Transfer App on Linux
- How to Securely Transfer Files Between Computers Using Croc
- Set Custom Croc’s Code Phrase
- How to Securely Transfer Text Messages Using Croc
- Use Croc with Your Relay Server to Securely Transfer Files
- Closing Thoughts
There are lots of ways to transfer files between two or more computers. Today, we will discuss yet another utility named Croc. This tutorial will show you how to install Croc and use it to transfer files between computers securely.
Croc is a file transfer system that sends files securely using end-to-end encryption via a file transfer relay. If you are curious about the name, it is inspired by the fable of the frog and the crocodile.
Croc’s key advantages are speed, security, and simplicity, all in one. In addition, transferring data using Croc is faster because it acts as a relay server between the systems.
In addition, it creates a full-duplex real-time communication layer between the two computers, so the “uploading” and “downloading” tasks coincide between those computers.
Croc is a cross-platform tool. It is written in GO programming language and freely available under an MIT license. You can install it on Linux, Mac, Windows, and Android and securely transfer files between them.
Moreover, Croc does not only work on the same LAN but on any two computers connected to the internet.
How to Install Croc Secure File Transfer App on Linux
Ubuntu and Other Debian-based Distros
Download the latest release (
.deb package) from the project GitHub page. At the moment of writing it is version 9.5.5.
We will use the wget command to download it:
Then you can install it by running
apt install, followed by the full path to the downloaded file:
sudo apt install ./croc_9.5.5_Linux-64bit.deb
If you would like to learn more about installing locally downloaded DEB files using the APT command, we recommend our great guide: How to Install deb Files in Ubuntu (with Examples).
Arch Linux and Other Arch-based Distros
pacman -S croc
The command shown below will install
curl https://getcroc.schollz.com | sudo bash
How to Securely Transfer Files Between Computers Using Croc
croc command to send a file or folder from your computer to any other computer is as simple as it can get. So first, Croc must be installed on both computers; the one that’s sending the files and the other that is receiving them.
To transfer a file/folder using
croc send <file-or-folder-path>
croc send documents.zip
Croc will generate random code phrases like the above. Here, the code phrase is
The code phrase is used to establish a password-authenticated key agreement (PAKE) which generates a secret key for the sender and recipient to use for end-to-end encryption. This ensures secure file transfers.
On the second computer (receiver), to receive the file or folder, all you have to do is type
Running this command will establish the connection with the sender, secure the channel, and ask you if you want to download whatever is being sent.
Once you accept the transfer, the download will begin, and you will see the progress in your terminal emulator. The same thing goes for the sender.
If you check the terminal on the machine sending the file, you will see the transfer progress.
Set Custom Croc’s Code Phrase
You can also securely transfer files or folders with a custom code of your choice using the
croc send --code psforevermore documents.zip
The recipient can receive the file using the following command:
How to Securely Transfer Text Messages Using Croc
You can also use Croc to send a text. This can be useful when you want securely to share a message or URL. To do that, all you have to do is type:
croc send --text "You're the color of my life"
The recipient can receive the text using the following command:
Use Croc with Your Relay Server to Securely Transfer Files
Now, baked into Croc’s configuration is using a public relay server that Croc’s creator has set up, but one can set up their relay server and configure croc to use it at runtime. To do this requires a one-time setup.
croc as a relay process on a server with a public address, for example,
Note also that ports 9009 through 9013 must be open on the firewall for network communication.
Then, we point
croc away from the default public relay when sending a file:
croc --relay "188.8.131.52:9009" send documents.zip
Then on the receiving end:
croc --relay 184.108.40.206:9009 1144-detect-linear-salmon
In a nutshell, Croc does the following:
- Securely transfer files, folders, and text between two computers using a relay
- Provides end-to-end encryption using PAKE library
- Transfers multiple files in one go
- Resumes interrupted file copying
- No central server port-forwarding needed
- Requires Zero dependencies
- Free and open source
Croc is a tool you need to check out if you are looking for a secure file transfer solution. There’s a lot more you can do with it, and we encourage you to read the author’s blog post about the tool.
What does this do that any of the many SSH-based tools available for Linux does not do already?
Thank you for the question, Jay. IMO, its big advantage is that it is cross-platform and enables easy cross-platform transfers (Linux, Windows, Mac).
Interesting! As I get it, another advantage would be that the only Internet-exposed host would be the relay, and that server would contain no private data and no credentials (other the ones in temporary use). And it doesn’t require an open SSH port in the F/W I suppose?. Since it supports interrupted file transfers I suppose it somehow uses rsync?
I write an iOS & macOS croc cli GUI app name iCroc , Try to down it from Appstore. U will love it.