linux下SSH传输文件

通过ssh传输文件
SSH进入对方机器:ssh remoteIP
scp -rp /path/filename username@remoteIP:/path #将本地文件拷贝到服务器上
scp -rp username@remoteIP:/path/filename /path #将远程文件从服务器下载到本地

tar cvzf – /path/ | ssh username@remoteip “cd /some/path/; cat -> path.tar.gz” #压缩传输
tar cvzf – /path/ | ssh username@remoteip “cd /some/path/; tar xvzf -” #压缩传输一个目录并解压

发表评论?

0 条评论。

发表评论


注意 - 你可以用以下 HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>