I have a linux jump box between me and a remote server. I have seen a few posts on how to do this with scp (e.g. here), but I am on a Windows box, so the situation is slightly different. I want to copy a file from my local windows machine, through a server setup as a gateway between the two. I should be able to do a multi-hop through the intermediate server. So something like this:

A -> B -> C

I don't want to copy the file to B, then log into B and copy the file again. I'd like to be able to run pscp on a number of files to copy them over.

3 Answers 3


I found that the best way to do this is to first establish a tunnel to the intermediate server (server B in the illustration). Then pscp over this link. I'll step through exactly what I did.

1) Create an SSH connection to serverB in PuTTY

enter image description here

2) For this connection create a tunnel that goes from port 2222 (you can pick another if you want) to serverC at port 22

enter image description here

3) Open a command window in Windows. Navigate to where PuTTY/pscp is installed on your machine (if not on the Path already)

4) Enter the following command (substituting your own values for those in {}):

c:\putty> pscp -P 2222 -pw {myPasswordOnRemoteMachine} c:\dev\fileIWantToCopy.txt {myusername}@

5) On the remote machineC, the file should be in the /tmp directory

  • An easier alternative on Windows is to just use WinSCP and use the tunnel feature built into that app.
    – Scott
    May 18, 2013 at 22:41

The easiest solution I found to this problem, was to not use pscp at all. Just use WinSCP to copy the file over.

  1. Enter your final server address (i.e. server 'C' in the question) in the session page and select SCP. enter image description here

  2. Click on 'Advanced...'. Go to Connection>Tunnel. Enter your jump server info here (i.e. Server 'B'). enter image description here

  3. Now just login with either your keyfile or password and you'll be tunneled in.


My even more complicated situation: A -> B -> C -> D ->E

I used PuTTY and FileZilla

A my Windows machine, 
B and C are gateways (very limited functionality)
D is the first Linux Machine and 
E is the target Linux Machine

I use PuTTY to: 
    ssh into B (w/username password) (IP of B is predefined in PuTTY) then
    ssh into C (w/username password) then manually
    ssh into D (w/username password) then manually
    ssh into E (at least this uses pubic key login so no uid/password!)

Once this is setup I then add tunnel to the IP of the final machine E in PuTTY thus:

OK now fire up FileZilla:

File > SiteManager:
Setup new connection to:
Host: Port: 7777
Protocol SFTP
Ask for password...


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .