I have a work computer that I can access using ssh on any computer. First I have to ssh into my work server. Then I have to ssh into the my work computer. It is super. However, I cannot figure out how to scp files from my work computer to my local desktop. What I have to do now is I have to go from the work computer and move it to the server. Then move it from the server to my local desktop. Is there a one step command so I don't have to move it to the server first?


migrated from stackoverflow.com Jul 21 '10 at 16:15

This question came from our site for professional and enthusiast programmers.


Is you computer a windows computer? If so, check out winscp. http://winscp.net/eng/index.php

SCP will have to be enabled on your server.

  • 1
    I don't think he needs help with scp. He needs a way to do a two-level scp transfer with one command (work computer -> work server -> home computer) – thethimble Jul 21 '10 at 2:06
  • using terminal on a mac. Yes thethimble two level scp is correct. Anyone know if this is possible? – keith Jul 21 '10 at 2:14

You could leave the following command running on the work server:

ssh -N user@work_client -L public_ip:20000:work_client:22

Where work_client is the IP address of the internal machine and public_ip is the public IP of the work server that you connect to.

That will create a tunnel from your internal machine port 22 to the 20000 port on the work server's public interface.

That will allow you to connect to the work server port 20000 from the internet and reach the internal machine.

  • did you mean the "<" at the end? – gatoatigrado Jul 21 '10 at 2:18
  • no I didn't. :) Typo. – sespindola Jul 21 '10 at 2:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy