How to transfer files between two computers, there are actually many methods, such as FTP or SSH to transfer files, but these methods are a bit complicated, FTP needs to build FTP service, SSH needs to learn SCP commands, So is there a better way to transfer files peer-to-peer from one computer to another?
The transmission process needs to be fast and safe. This article will introduce a set of tools written in Go language called Croc. This tool has the following functions and advantages.
Tool Features and Benefits
- Use Relay to transfer files between any two computers
- Peer-to-peer encryption (using PAKE)
- Transfer files across platforms (Windows, Linux, Mac)
- Multiple files or entire directories can be transferred at once
- Supports resuming from a breakpoint
- No need to build your own server or use port-forwarding related technologies
- IPv6 is preferred, IPv4 is used as a backup
- Socks5 proxy can be used
Croc project address: https://github.com/schollz/croc
Install
Download the latest version for your system and install the latest version from the command line:
$ curl https://getcroc.schollz.com | bash
On macOS, you can install the latest version with Homebrew:
$ brew install croc
How to use
One sender and one receiver, as shown in the following figure:
sender
Receiving end
The sender only needs to execute croc send file.txt
As you can see above, a secret code will be automatically generated, and then the following instructions will be executed on another computer
Of course, you can also order the secret code yourself
croc send --code appleboy ~/Downloads/data.csv
Since this tool is transmitted through relay server, the command will be connected to the official server by default.
Suppose you want to deploy a Relay Server yourself? Very simple, this tool also allows users to quickly set up their own device Relay Server, just execute the following command:
A single Port can be specified:
Then, when sending the file, it should also be replaced. Relay Server
You can see that you only need to add --relay 127.0.0.1:3001 to complete, so deploying Relay Server is very simple. Even if the official service is down, you can install Relay Server on any computer.
experience
Croc tool emphasizes: simple + safe + fast , three major advantages, making it easier for everyone to transfer files point-to-point, plus CLI tools can be downloaded on any platform (Windows, Mac, and Linux), only one command is needed. Install this tool to quickly transfer files with other users.