服务器间文件传输方案[nc命令]

1)端口扫描

nc -v -w 2 192.168.2.34 -z 21-24
    nc: connect to 192.168.2.34 port 21 (tcp) failed: Connection refused
    Connection to 192.168.2.34 22 port [tcp/ssh] succeeded!
    nc: connect to 192.168.2.34 port 23 (tcp) failed: Connection refused
    nc: connect to 192.168.2.34 port 24 (tcp) failed: Connection refused

2)从192.168.2.33拷贝文件到192.168.2.34

在192.168.2.34上: nc -l 1234 > test.txt
    在192.168.2.33上: nc 192.168.2.34 < test.txt

3)简单聊天工具

在192.168.2.34上: nc -l 1234
    在192.168.2.33上: nc 192.168.2.34 1234

4) 拷贝文件带进度

cat CentOS-6.9-x86_64-bin-DVD2.iso |pv -b | nc  45.55.0.86 9999

5) rsync拷贝文件带进度

rsync -v -W --progress worker@in-test-cv-server-1:/home/worker/jianli.yang/research/video_cla/video_1/video_7.tar ./

发布了16 篇原创文章 · 获赞 2 · 访问量 8892

猜你喜欢

转载自blog.csdn.net/hihei_set/article/details/90521156