Aug 18, 2011
tom

Transfer files via SSH

Question

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?

Answer

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)

Related posts:

  1. Quickest way to transfer 55GB of images to new server
  2. how to transfer files from desktop to server when using ssh
  3. Transfer large files over the internet from a Linux VPS to Windows machine
  4. resuming transfer of files over ssh from remote linux to local windows
  5. Is it possible to use rsync over sftp (without an ssh shell)?

Leave a comment