Fernando Briano Asked: 2010-03-10 11:33:06 +0800 CST2010-03-10 11:33:06 +0800 CST 2010-03-10 11:33:06 +0800 CST Transfer files via SSH 772 I want to use file transfer via SSH on some scripts. I've read it's possible to tar over ssh. Where should I start reading? file-transfer ssh 4 Answers Voted Best Answer Zoredache 2010-03-10T11:40:22+08:002010-03-10T11:40:22+08:00 To do file transfer over ssh you can use scp scp -r /srcdir/ user@remotehost:/destdir/ use rsync over ssh (see the -e parameter) rsync -e ssh -a /srcdir/ user@remotehost:/destdir/ use some tool that transfers data via stdin/out (tar, cpio, etc) cd /sourcedir; tar -c . | ssh username@remotehost bash 'cd /dstdir; tar -x Mount the filesystem via sshfs (if fuse is supported on your system) Kevin K 2010-03-10T11:39:34+08:002010-03-10T11:39:34+08:00 O'Reilly has a book with it all - SSH, The Secure Shell: The Definitive Guide - if you Google for it, there are many references, places to buy it, and view it online. Carl Bergquist 2010-03-10T11:36:49+08:002010-03-10T11:36:49+08:00 Im no expert, but I think http://en.wikipedia.org/wiki/Secure_copy is what you want. Dan Andreatta 2010-03-12T05:55:00+08:002010-03-12T05:55:00+08:00 For tar over ssh, you can use the fact the ssh forwards stdin and stdout. So you can do ssh server 'tar czf - /some/dir/' > tarfile.tar.gz and have the backup on the local machine.
To do file transfer over ssh you can
scp -r /srcdir/ user@remotehost:/destdir/
rsync -e ssh -a /srcdir/ user@remotehost:/destdir/
cd /sourcedir; tar -c . | ssh username@remotehost bash 'cd /dstdir; tar -x
O'Reilly has a book with it all - SSH, The Secure Shell: The Definitive Guide - if you Google for it, there are many references, places to buy it, and view it online.
Im no expert, but I think http://en.wikipedia.org/wiki/Secure_copy is what you want.
For tar over ssh, you can use the fact the ssh forwards stdin and stdout. So you can do
and have the backup on the local machine.