可以简单用scp 命令来实现
TimZhaodeMacBook-Pro:~ tim$ scp -- h
usage: scp [-346BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file]
[-l limit] [-o ssh_option] [-P port] [-S program]
[[user@]host1:]file1 ... [[user@]host2:]file2
TimZhaodeMacBook-Pro:~ tim$
OPTIONS:
-v 显示进度。可以用来查看连接、认证、或是配置错误
-P 选择端口
-r 复制目录