ssh传输文件

通过ssh传输文件
SSH进入对方机器:ssh remoteIP

scp -rp /path/filename [email protected]:/path #将本地文件拷贝到服务器上
           
scp -rp [email protected]:/path/filename /path #将远程文件从服务器下载到本地
             eg:scp -rp [email protected]:/data/log.txt /data

tar cvzf - /path/ | ssh [email protected] "cd /some/path/; cat -> path.tar.gz" #压缩传输
tar cvzf - /path/ | ssh [email protected] "cd /some/path/; tar xvzf -" #压缩传输一个目录并解压
;