任意2台电脑间安全高效传输文件

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

  • https://github.com/schollz/croc
  • https://schollz.com/tinker/croc6/
  • 安全高效 目前我个人一直在使用

所有电脑安装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://becool.vip:666/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)
你在哪里?

本文由 mdnice 多平台发布

  • 8
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

疯子爱淡定

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值