Custom Search

Wednesday, August 21, 2013

How to do sparse file copy between two servers using ssh-agent

Working Command
============
1)
#ssh-agent $SHELL

2)
#ssh-add ~/.ssh/id_rsa

3)
#ssh -A root@192.168.1.24 "cd /var/cache/disks && ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no root@192.168.1.45 'cd /mnt/share && tar -czSf - myfile.txt' | tar -xzf -"

4)
Note : Location of Single and double quote are very important.

5)
http://docstore.mik.ua/orelly/networking_2ndEd/ssh/ch02_05.htm

2 comments:

  1. Note : Location of Single and double quote is very important.

    ReplyDelete
  2. working command without spares copy
    #ssh -A root@192.168.1.24 scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no root@192.168.1.45:/mnt/share/myfile.txt /var/cache/disks

    ReplyDelete