Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I use putty on windows vista to establish ssh connection to ubuntu on ec2.

I want the ubunto to do wget on some iis url in my vista. This url is not exposed to the web. Is there a way to establish such network between the host and guest?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Yes you can use ssh tunneling to achieve this. In your putty config go to:

Connection>SSH>Tunnels

The add a remote tunnel with source port of whatever you like (eg 8888) and destination of localhost:80.

  • Untick "Local ports accept connections from other hosts"
  • Untick "Remote ports do the same"
  • Source port: 8888
  • Destination: localhost:80
  • Choose "Remote"
  • Choose "Auto"

Then when you hit http://localhost:8888 on your remote server you'll actually be getting your local machine's web server on port 80.

share|improve this answer
    
wget localhost:8888 gives me "failed: Connection refused". On the tunnels tab I used all the default settings, maybe I should change something? –  Yaron Naveh Jan 7 '12 at 13:34
    
Untick "Local ports accept connections from other hosts" Untick "Remote ports do the same" Source port: 8888 Destination: localhost:80 Choose "Remote" Choose "Auto" –  SimonJGreen Jan 7 '12 at 13:48
    
it is not checked by default –  Yaron Naveh Jan 7 '12 at 13:49
    
I've updated my answer with full steps –  SimonJGreen Jan 7 '12 at 13:50
    
I've just installed Apache on my local Windows machine and tested this myself from a remote server to check I'm not going crazy and it works! # telnet localhost 8888 Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. GET / <html><body><h1>It works!</h1></body></html>Connection closed by foreign host. –  SimonJGreen Jan 7 '12 at 13:52

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.