Topic "SSH Proxy"

Author Message
Merlin
[View user's profile]

Joined: 2003-11-02
Posts: 3
Location: Paris, France
Is there any way to use a ssh proxy with winscp ?
I need to get files from a ssh box which is behind another ssh box.
I usually connect with putty to the first one then to the second one and scp files to my local ssh server.
But it would save me great time if I could directly get my files using winscp.

Tanks.
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
There is Proxy tab on login dialog. You must check "Advanced optinos" to see it.
_________________
Martin Prikryl
Merlin
[View user's profile]

Joined: 2003-11-02
Posts: 3
Location: Paris, France
Ive seen the proxy tab, but I dont think its working for me here.
Lets take an example to describe what Im trying to do:

On one side, there is my local network connected to the internet (no problem on this side).
On the other side, a distant network connected to the internet with a gateway. On the distant network every computer can get access to the internet, but due to routing mechanism its only one way (you cannot connect directly to a computer inside this network from the internet).
- The only way is to login on this distant networks gateway using ssh and then to any computer you want inside the network.
- The gateway is a very minimalist system and I do not have access to my files directly on it, I need to connect to the fileserver inside the distant network.
- As I am not root on any computer of the distant network I cannot change anything on the gateways configuration.

So well say that my local network is localnet.com and the network Im trying to reach distantnet.com.
I have an account (ie: johndoe) on every box I need to connect to with my private/key pairs set correctly so I do not have to type any password.
Usually I would proceed like this using any ssh client:

Code:
winbox.localnet.com> ssh johndoe@gateway.distantnet.com
gateway.distantnet.com> ssh johndoe@fileserver.distantnet.com
fileserver.distantnet.com> scp  whateverfiles johndoe@linuxbox.localnet.com:/tmp


At this point I have all the files I need on my linux box in my local network and I use Winscp to get the files to my windows box.

So what I am trying to do is use Winscp to connect to the fileserver through the gateway to avoid copying the files on my linux box.

Ive tried to use the telnet proxy on the ssh gateway (with the port set to 22 and with different command) but it doesnt seems to work. Maybe I am doing something wrong or maybe winscp doesnt support using a ssh connection as a proxy ?
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
OK, now I understand, what is your question. WinSCP cannot do this. You may try to setup your account on Proxy to directly ssh to other server on login. But it would work only if there would be no password prompt.
_________________
Martin Prikryl
Merlin
[View user's profile]

Joined: 2003-11-02
Posts: 3
Location: Paris, France
Maybe it could be a feature on an upcoming version of winscp? Wink

Anyway, it worked for me the way you suggested:
Ive set de command option in my authorized_keys file on the gateway to ssh to the fileserver.
So know I have a key I use only when I identify using winscp and only with this key the gateway login to the fileserver before reading the current directory.
This way I can still login to the gateway without being forwarded whenever I use another key and I can enjoy winscp to retrieve my files Smile

Update by 'prikryl': See last post to this topic for other solution.

Thank you for your help and your work on winscp.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
First of all, thanks for sharing you solution.

Merlin wrote:
Maybe it could be a feature on an upcoming version of winscp? Wink

I'm not sure if this can be done. I may invoke "ssh" command of startup, the way you did it. However WinSCP cannot allocate pseudo-terminal, which means that ssh cannot prompt user for password, etc. So it would work only with unencrypted private key, which is very restrictive. Any suggestions are appreciated.
_________________
Martin Prikryl
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
For other solution how to connect thru "SSH Proxy" see last post of this topic.
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License