Like us on Facebook!

Monday, 8 April 2013

Linux - other ways to copy files to a remote host

Useful tips –

To copy a single file over without using scp
  1. cat file | ssh root@host 'cat > file'
  2. ssh root@host 'cat > file' < file
using public/private key to run scripts on a remote hosts without the need to enter passwords
  • cat to_be_remote_executed | ssh -i private-key-file root@host | cat > result
to transfer multiple files across in one go

  • tar -cvf - . | ssh root@host 'cd whereever; tar -xvf - '

No comments:

Post a Comment

Have your say!