安利一个最近喜欢的文件传输工具

所有电脑安装croc

https://github.com/schollz/croc
curl https://getcroc.schollz.com | bash
https://github.com/schollz/croc/releases

建立自己的文件互传中继

  • 挑选1台由公网IP的服务器做中继 记录自己的ip
nohup croc relay >croc_relay.log 2>&1 &
ubuntu@VM-0-7-ubuntu:~/shell$ cat croc_relay.log
nohup: ignoring input
[info]	2023/05/09 14:59:07 starting croc relay version v9.6.4-1fce28e
[info]	2023/05/09 14:59:07 starting TCP server on :9009
[info]	2023/05/09 14:59:07 starting TCP server on :9010
[info]	2023/05/09 14:59:07 starting TCP server on :9011
[info]	2023/05/09 14:59:07 starting TCP server on :9012
[info]	2023/05/09 14:59:07 starting TCP server on :9013

如果没有公网ip也可以用下面我自己的服务器体验

http://bereal.becool.vip:6431/gethomeip

发送文件

切换到文件所在目录
[root@VM-100-15-centos ~/shell]# croc --relay "113.109.242.138:9009" send Mazu_shark.log.2023050815
Sending 'Mazu_shark.log.2023050815' (29.8 MB)
Code is: 4248-never-jazz-japan
On the other computer run

croc --relay 113.109.242.138:9009 4248-never-jazz-japan

接收文件

在另外一台机器 执行上面的命令
tmp croc --relay 113.109.242.138:9009 4248-never-jazz-japan
connecting...2023/05/09 15:09:34 could not connect to 113.109.242.138:9009: initial bytes are not magic: 48545450
➜  tmp croc --relay 113.109.242.138:9009 4248-never-jazz-japan
Accept 'Mazu_shark.log.2023050815' (29.8 MB)? (Y/n) Y

Receiving (<-14.22.11.164:23787)
Mazu_shark.log.2023050815 100% |████████████████████| (30/30 MB, 23 MB/s)

安全发送消息

➜  tmp croc --relay "113.109.242.138:9009" send --text "你在哪里?"
Sending 'text' (15 B)
Code is: 5801-thermos-index-polo
On the other computer run

croc --relay 113.109.242.138:9009 5801-thermos-index-polo

安全接受消息

[root@VM-100-15-centos ~/shell]# croc --relay 113.109.242.138:9009 5801-thermos-index-polo
Display text message (15 B)? (Y/n) Y

Receiving (<-183.60.88.11:49740)
你在哪里?