Transfering files using ssh via 2 gateway machines - SSH

This is a discussion on Transfering files using ssh via 2 gateway machines - SSH ; Hi, I am having trouble transfering files from a source UNIX machine to a destination UNIX machine via 2 gateway machines. The user used for the transfer has been setup so no password is required to login from: source to ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: Transfering files using ssh via 2 gateway machines

  1. Transfering files using ssh via 2 gateway machines

    Hi,

    I am having trouble transfering files from a source UNIX machine to a
    destination UNIX machine via 2 gateway machines.

    The user used for the transfer has been setup so no password is
    required to login from:
    source to gateway1
    gateway1 to gateway2
    gatewway2 to destination

    This is the command excuted from the source computer:
    tar cf - .|ssh g1 ssh g2 "ssh dest 'cd /tmp;tar xf -'"

    I get
    tar: blocksize = 0

    If I change the command to:
    tar cf - .|ssh g1 ssh g2 "ssh dest tar xf -"

    Then the files are transfered albeit into the wrong directory but the
    command on the source computer never completes.

    How can I fix:
    1) get the cd /tmp to work
    2) get the command to come back when the transfer is complete

    Thanks for any help

  2. Re: Transfering files using ssh via 2 gateway machines

    pwu@qantas.com.au wrote:
    > Hi,
    >
    > I am having trouble transfering files from a source UNIX machine to a
    > destination UNIX machine via 2 gateway machines.
    >
    > The user used for the transfer has been setup so no password is
    > required to login from:
    > source to gateway1
    > gateway1 to gateway2
    > gatewway2 to destination
    >
    > This is the command excuted from the source computer:
    > tar cf - .|ssh g1 ssh g2 "ssh dest 'cd /tmp;tar xf -'"
    >
    > I get
    > tar: blocksize = 0
    >


    You need to set up an SSH tunnel, I think. Take a good look for help pages, or
    the book fro O'Reilly on SSH, on just how to do this.

  3. Re: Transfering files using ssh via 2 gateway machines

    Nico Kadel-Garcia wrote:
    > pwu@qantas.com.au wrote:
    >> Hi,
    >>
    >> I am having trouble transfering files from a source UNIX machine to a
    >> destination UNIX machine via 2 gateway machines.
    >>
    >> The user used for the transfer has been setup so no password is
    >> required to login from:
    >> source to gateway1
    >> gateway1 to gateway2
    >> gatewway2 to destination
    >>
    >> This is the command excuted from the source computer:
    >> tar cf - .|ssh g1 ssh g2 "ssh dest 'cd /tmp;tar xf -'"
    >>
    >> I get
    >> tar: blocksize = 0
    >>

    >
    > You need to set up an SSH tunnel, I think. Take a good look for help
    > pages, or the book fro O'Reilly on SSH, on just how to do this.


    Oh, yes: and to extract a tar to an alternative location, such as /tmp, try
    this, try this:

    tar xf - -C /tmp

    And note that what you are doing there is likely to reset the permissionf of
    the /tar directory itself! You should really specificy a target subdirectory,
    not be transferring the contents of '.' around without thinking carefully
    about whether the settings of '.' are what you want to transfer, as well.

+ Reply to Thread