When it comes to file sharing, there are plenty of options for you to choose from. Most of them are slow because you first need to upload the file(s) to a cloud somewhere and then share the download link, and some of them are secure and anoynymous like onionshare.
So here’s yet another tool that you can use: croc. A CLI tool that allows any two computers to simply and securely transfer files and folders.
ALSO READ:
- Transfer Files Over Wi-Fi Between a Computer and a Mobile Device by Scanning a QR Code
- HOW TO: Easily Mount Remote Filesystems on Linux, macOS and Windows with SSHFS
FEATURES
- allows any two computers to transfer data (using a relay)
- provides end-to-end encryption (using PAKE)
- enables easy cross-platform transfers (Windows, Linux, Mac)
- allows multiple file transfers
- allows resuming transfers that are interrupted
- local server or port-forwarding not needed
- ipv6-first with ipv4 fallback
- can use proxy, like tor
HOW TO INSTALL
- macOS – via Homebrew with
brew install croc
- Windows
- via Chocolatey with
choco install croc
- via Scoop with
scoop install croc
- via Chocolatey with
- UNIX/Linux
- Arch and derivates
sudo pacman -S croc
- Ubuntu
snap install croc
- Gentoo
emerge net-misc/croc
- Termix
pkg install croc
- FreeBSD
pkg install croc
- UNIX
nix-env -i croc
- Arch and derivates
HOW TO USE
NOTE: This should go without saying, but croc needs to be installed on both computers ( the one that’s sending the file(s) and the one receiving them ). Also, I am using macOS and Linux virtual machine to test and write this article/tutorial. If the screenshots below might look like they were taken on the same machine, they’re not.
First, let’s see the configurable option for croc. A set of options (like custom relay, ports, and code phrase) can be set using --remember
.
Using croc to send a file or folder from your computer to any other computer is as simple as it can get. To send a file or a folder all you have to do is open your preferred terminal emulator and type croc send path-to-file-or-folder
.
Croc will index the file or folder that you want to share and will create a passphrase for you. The passphrase 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.
On the second computer ( receiver ), to receive the file or folder all you have to do is type croc passphrase
( in this case it’s croc cyclone-caramel-nuclear
). Running this command will establish the connection with the sender, secure the channel and will 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. Same thing goes for the sender. If you check the terminal on machine that’s sending the file, you will be able to see the transfer progress.
You can also use croc to send text. To do that all you have to do is type croc send --text "Your Text Here"
.
If you’d like to set your own passphrases, you can do that with croc send --code your-own-passphrase path-to-file-or-folder
Croc is definitely a tool that you need to check out. There’s a lot more you can do with croc and I enourage you to read the project’s Github page and the author’s blog post about the tool.
Another thing you should always remember and consider is that sensitive data should ALWAYS be encrypted. Does not matter how secure the tool or service you’re using might be, encrypt first. Especially if you’re using services like Dropbox, iCloud, Google Cloud and so on.