0

When I SSH tunnel into my VPS, I do so from port 22 to port 22.

How could I also tunnel from port 2222 to port 80 in the same connection in Putty?

In OpenSSH for example, I would do:

ssh user@1.1.1.1 -L 22:localhost:22 -L 2222:localhost:80 -i ~/.ssh/key

But this time of course, I need a similar way with Putty.

Update 1 - Update for Rubio:

I entered 2222 (source) and 80 (destination) and saved the sessions data. I quited Putty and saw the data wasn't saved, so I try to add this directly from that section but then got an error.

enter image description here

4

PuTTY Configuration

  • Connection
    • SSH
      • Tunnels

Put in source port 2222, and destination localhost:80.

Use "Add new forwarded port" section to add the new ports you want to forward.
If you want to forward multiple ports, PuTTY will let you forward more than one port by putting in their information one at a time and "Add"ing them; repeat to add as many as you need to configure. Each forwarded port should show up in the list of forwarded ports.

  • Data isn't saved for the session, please see update in question. – JohnDoea Jan 1 '17 at 4:36
  • 1
    Put in source port "2222", and destination "localhost:80". – Rubio Jan 1 '17 at 4:39
  • 1
    The "localhost" part is important, as it turned out your answer was incomplete without it. You should have edit your answer. I did it for you. Next time, please, don't put crucial information in a comment only. – Kamil Maciorowski Jan 1 '17 at 5:38

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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