Using WinSCP with SFTP server and two SSH tunnel hops

4

1

I'm on a Windows machine using PuTTY to ssh into my schools server. From there I need to slogin -XY machine1 and then slogin -XY machine2.

Ideally, I'd like to use WinSCP to connect and transfer files. I know I can do this by using two copies of PuTTY, one to ssh into the server and create a proxy, and the second PuTTY to connect to the proxy and login to machine1 and create a second proxy. I can then use WinSCP to connect to the proxy server and login to machine2...

Is there a simpler way of doing this?

Mike

Posted 2012-09-20T03:35:51.453

Reputation: 41

Answers

2

You can use MobaXterm: it has a graphical sftp function like WinSCP, but it also allows you to go through your machine hops automatically. They call it "SSH bouncing".

You just have to
- download MobaXterm from here: http://mobaxterm.mobatek.net/download-home-edition.html
- Click on "New session" and choose "ssh"
- Specify your first machine name or IP address in the "SSH bouncing (connect through a gateway ssh server).

Didier

Posted 2012-09-20T03:35:51.453

Reputation: 789

But that's for a single hop only. WinSCP can do that too. The question is about two hops. That does not seem to be possible with MobaXterm. While actually WinSCP can do it, as my answer shows.

– Martin Prikryl – 2019-10-04T11:50:48.707

1

Are machines 1 and 2 unix based? If so, couldn't you just use Unix scp? You wouldn't be able to use winscp to transfer files between two unix based systems anyway.

From source machine,

scp -rp user@hostname:destination_directory /path/to/files

You haven't made it clear exactly where from and where to you want to transfer the files.

Jay

Posted 2012-09-20T03:35:51.453

Reputation: 1 038

@Jay WinSCP supports SCP, as does PuTTY (pscp -scp, all other SCP params should be the same) – JW0914 – 2019-10-04T11:50:39.477

yes machines 1 and 2 are unix based. I am wanting to transfer files from my windows pc to the machine2. – Mike – 2012-09-20T05:09:11.297

Well, you could copy the files into the server first on winscp and then 'scp -rp' to transfer them from the server to machine – Jay – 2012-09-20T05:18:32.240

0

WinSCP has direct support for one hop.
See the Tunnel page of its Advanced site settings dialog.

For the other hop (the first of the two), you can use plink in "local proxy command" feature.


The configuration will look like:

Martin Prikryl

Posted 2012-09-20T03:35:51.453

Reputation: 13 764

Depending on the SSH server being utilized, it may be required to load the 1st SSH server's key into Pageant manually, as I know I have to do so in PuTTY for certain SSH servers to allow the multi-hop to authenticate successfully to the first server before going on to the next, else the multi-hop to to the second server won't begin (with these specific SSH servers) – JW0914 – 2019-10-04T11:46:43.713

1@JW0914 Good point. I've edited my answer to cover that too. – Martin Prikryl – 2019-10-04T11:54:11.963