SFTP through proxy

3

1

I have a large amount of data on scratch space at computer b that I want to get.

In my network I cannot directly connect to computer b (ssh exits with "No route to host"); I must first connect to computer a, and then connect to computer b.

I cannot move the data from the scratch space on computer b to computer a because of a disk quota that is imposed on me at computer a.

How can I move the data from computer b to my computer in this situation?

aerodynamic_props

Posted 2010-04-15T21:08:15.453

Reputation: 31

How can you connect to computer b? – Thorbjørn Ravn Andersen – 2011-01-26T14:34:50.400

Answers

2

If nc suggested by Ignacio is not available on computerA, you can create a tunnel:

ssh -f -N -L 1234:computerB:22 computerA

(drop -f to keep it from going to the background). You should then be able to connect to port 1234 on localhost to access computerB, i.e.

scp -P 1234 user_on_computerB@localhost:/awesome/stuff/there /here

Benjamin Bannier

Posted 2010-04-15T21:08:15.453

Reputation: 13 999

1

Use ProxyCommand in your ssh config, along with nc on computer A:

Host computerB
    ProxyCommand ssh computerA nc computerB 22

Ignacio Vazquez-Abrams

Posted 2010-04-15T21:08:15.453

Reputation: 100 516

0

  • one option is to mount b into a, from a:

    sshfs computer_b /mnt/PC_b
    

then copy directly to the mount

  • another option if a and b machines are in the same LAN, to export via NFS data folder from b machine and mount it in a machine

jet

Posted 2010-04-15T21:08:15.453

Reputation: 2 675