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:
wget https://github.com/schollz/croc/releases/download/v9.5.5/croc_9.5.5_Linux-64bit.deb
Code language: JavaScript (javascript)
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
Other Distros
The command shown below will install croc
in /usr/local/bin/
location.
curl https://getcroc.schollz.com | sudo bash
Code language: JavaScript (javascript)
How to Securely Transfer Files Between Computers Using Croc
Using the 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
, run:
croc send <file-or-folder-path>
Code language: HTML, XML (xml)
Example:
croc send documents.zip
Code language: CSS (css)
Croc will generate random code phrases like the above. Here, the code phrase is 8344-think-unit-pulse
.
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 croc 8344-think-unit-pulse
.
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.
croc 8344-think-unit-pulse
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 --code
option.
croc send --code psforevermore documents.zip
Code language: CSS (css)
The recipient can receive the file using the following command:
croc psforevermore
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"
Code language: JavaScript (javascript)
The recipient can receive the text using the following command:
croc 4727-dallas-modem-retro
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.
Run croc
as a relay process on a server with a public address, for example, 20.237.185.29
:
croc relay
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 "20.237.185.29:9009" send documents.zip
Code language: CSS (css)
Then on the receiving end:
croc --relay 20.237.185.29:9009 1144-detect-linear-salmon
Code language: CSS (css)
Closing Thoughts
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
- Cross-platform
- 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.