0

I'd like to initate a download using wget in a remote putty terminal (i.e. an ubuntu server), but using my local windows internet connection.

I guess there is two way to achieve this:

  • run an HTTP local proxy on my windows workstation, then enable an SSH tunnel and use the created proxy
  • use iptable rules to make the connected user in putty using my connection, eventually running a new kind of SSH tunnel

Is there any other way ?

snowflake
  • 155
  • 1
  • 7
  • Did you already try to use Putty on your Windows box to setup a http tunnel (like this: http://howto.ccs.neu.edu/howto/windows/ssh-port-tunneling-with-putty/ ). Requires no permanent software/setup/configuration on either end. – agtoever Aug 15 '14 at 18:03

2 Answers2

1

Let's say you're trying to tunnel http://google.com/?q=ssh+tunnel:

In PuTTY:

  1. Settings > Connection > SSH > Tunnels
  2. Source port: 40000
  3. Destination: google.com:80
  4. Type: Remote

Then on the remote ssh session:

wget localhost:40000/?q=ssh+tunnel

This won't work if the website you're trying to download issues a redirect, though.

Darth Android
  • 37,872
  • 5
  • 94
  • 112
1

Your idea of installing a local proxy server is probably simplest. I've done this many times, but where the proxy server is on the ssh-server side, not client. You just need to reverse the ssh tunnel.

I don't know if this will work without having another proxy server available, but I've used cntlm[1] on windows to simplify dealing with authenticating corporate proxies. On linux I use squid, more from inertia than anything, though nowadays varnish seems more popular. [2] has some other suggestions.

[1] http://cntlm.sourceforge.net/ [2] Freeware local proxy engine for Windows?

Ian McGowan
  • 238
  • 1
  • 5