

How to Install and Use croc to Securely Transfer Files on Linux
source link: https://www.makeuseof.com/install-use-croc-to-transfer-files-linux/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

How to Install and Use croc to Securely Transfer Files on Linux
Published 35 minutes ago
Want to share files with other devices using the Linux command line? Check out croc, an easy-to-use cross-platform file transfer utility for Linux.
Transferring files between computers is a relatively straightforward act if you have the right tool. While most file transfer tools work the same and share a similar feature set, a few stand out with their distinctive features.
Croc is one such tool. It works via the command line and lets you transfer files and folders between computers quickly and securely.
Follow along as we discuss croc and list down the instructions to use it for transferring files between Linux and any other device.
What Is croc?
Croc is a cross-platform file transferring tool that allows you to share files and folders between two computers in a quick and secure manner. It works through the command line and is compatible with all major computer platforms: Linux, macOS, and Windows.
One aspect of croc that separates it from other file-sharing tools is how it handles data transfers. For starters, croc uses a relay server—instead of uploading files to a server, unlike other tools—to create a full-duplex communication layer between the two computers for transferring data. As a result, it's much quicker and doesn't require port forwarding to transmit files.
Similarly, croc employs the PAKE (Password Authenticated Key Exchange) cryptography method to ensure your transferred data remains secure, which is something you usually don't find on other file transfer utilities.
Why Should You Use croc?
Below are some of the standout features of croc that distinguish it from other cross-platform file sharing tools:
- Croc uses a relay server to transfer data, which works by creating a full-duplex communication layer that allows for simultaneous uploading and downloading of content on both computers, and in turn, improves transfer rates.
- Building upon the previous point, another added advantage of using a relay server is that you don't have to set up port forwarding on the network to transfer data with croc over LAN or over the internet.
- Croc uses PAKE, which provides end-to-end encryption to ensure all your data transfers take place securely over the network.
- At times when the transfer gets interrupted midway—may be due to a bad connection—the tool lets you resume transfers, so you don't have to go over the process again.
- Croc lets you use a proxy, like Tor, to add an extra layer of security to your computer during file transfers.
- You can also choose to self-host the relay server using Docker or other similar services.
Related: How to Install Docker on Ubuntu Linux
How to Install croc on Linux?
Croc works on all major Linux distros, and you can install it on your computer using the following steps.
First, download the latest release of croc for your system from the link below.
Download: Croc
To install the DEB package on Ubuntu/Debian, first, launch the terminal. Then, navigate to the directory where you've downloaded the file and type in the following command:
sudo dpkg -i croc-*.deb
Alternatively, if you're on Arch Linux, you can install croc by running:
sudo pacman -S croc
Similarly, to install it on FreeBSD, use:
pkg install croc
If you can't find an installer for your distro, issue the following command to download and execute the installation script:
curl https://getcroc.schollz.com | bash
Since croc facilitates file transfer between two computers, it goes without saying that you also need to have croc installed on the other device. Head over to croc's GitHub to find out instructions on how to install it on your device.
How to Use croc to Share Files
With croc installed on your computers, you can now use it to do both: share files and receive files. So depending on your use case, follow the instructions below to transfer files from/to your Linux computer.
Transfer Files From Linux to Another Device
For situations where you want to transfer files from your Linux machine to some other computer (running another operating system), follow the steps below to carry out the send operation in croc.
Since the entire operation in croc takes place through the command line, make sure you have it opened on both your computers. Then, on your sending device, which is your Linux machine in this case, type the following command in the terminal and hit Enter:
croc send file_name
For example:
croc send MyText.txt
As soon as you do that, you'll see a code right below the Sending message. This code is what will allow you to receive the files on another computer.
Go back to the command prompt on the receiving computer and enter the command using the syntax below:
croc your_code_here
For instance, if your code is alpha1, you'd need to enter:
croc alpha1
Enter y to accept the incoming file and download it to your device.
Once the code matches on both machines, a PAKE is established and the transfer begins. In addition, the program also generates a secret key for end-to-end encrypted data transfer between both parties.
Although croc's random code phrases do the job, they can sometimes be too long to type. As an alternative, you can generate a custom code yourself when initiating the transfer. For this, modify the command syntax as shown below:
croc send --code your_code_phrase file_name
Similar to sending files, croc also allows you to send text, which can come in handy when you want to share a message or a URL. Use the following syntax to send a text via croc:
croc send --text "your_text_here"
For example:
croc send --text "hello"
On the receiving device, enter the code phrase generated by the above command and hit y, when prompted, to view the message.
Receive Files From Another Device to Linux
Much like sharing files from your Linux computer, there might be times when you'd want to receive files from another device to your Linux machine.
In such situations, you can simply reverse the process, as demonstrated in the steps below.
On the sending machine, open the command line and run:
croc send file_name
Go back to your Linux machine, and in the terminal window, enter:
croc code_phrase
Again, enter y to accept the file.
Transferring Files Between Computers With Ease
Most file transferring apps offer cross-platform functionality these days. However, what separates croc from the rest is its ease-of-use, quick and secure nature that facilitates file transfers between computers running different operating systems.
In fact, croc is said to be the only CLI-based file transferring tool with such an extensive feature set, making it a perfect file transfer companion for those who prefer working through the command line.
Having said that, you can also check out qrcp, a free file transfer utility that uses QR codes to help you transfer files between Linux, Android, and iOS.
About The Author

Yash Wate (28 Articles Published)
Yash is a Staff Writer at MUO for DIY, Linux, Programming, and Security. Before finding his passion in writing, he used to develop for the web and iOS. You can also find his writing on TechPP, where he covers other verticals. Other than tech, he enjoys talking about astronomy, Formula 1, and watches.
Subscribe to our newsletter
Join our newsletter for tech tips, reviews, free ebooks, and exclusive deals!
Recommend
-
8
Croc Croc是一款安全性极强的点对点数据传输工具,该工具允许两台计算机设备以一种简单和安全的方式来传输文件或文件夹。简而...
-
9
Moving Data Securely and Quickly with croccroc written by Eric J. Ma on 2020-10-01 | tags:
-
11
This post includes SCP examples. SCP or secure copy allows secure transferring of files between a local host and a remote host or between two remote hosts. It uses the same authentication and security as the Secure Shell (SSH) protocol from w...
-
10
-
6
<?xml encoding="utf-8" ??>Introduction When using commands like scp or rsync with the public IP address of your server, you will automatically transfer the files over t...
-
9
Google Takeout will get more ways to securely transfer files across different services Google promised $3 million in funding for the Data Transfer Project ...
-
6
How to use SCP and SFTP to securely transfer files By using SSH-based authentication, SFTP and SCP are handy commands for moving...
-
7
开源点对点数据传输工具-Croc – 开源派 Croc是一款强调安全性的点对点数据传输开源工具,该命令行工具允许两台计算机设备以一种简单和安全的方式来传输文件或文件夹。基于
-
9
Petar's blog CROC-MBTU 2012, Eliminati...
-
4
Support is great. Feedback is even better."Hi there! Thanks for trying out Blaze Transfer. We value your feedback and would love to hear your thoughts on our platform. Your feedback will help us improve and motivate our team's effort...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK