I am new to ssh-tunneling.

Basically I want to be able to get ssh access to servers in a remote lab (say subnet 1.2.3.X).

I can log into a machine that is visible say

I want to be able to log into machines in 1.2.3.X subnet through ssh tunneling, but I am not sure what exactly needs to be done.

Logging into the machines through the machine I can already log into is an option, but I have my development files on my local pc. So I wanted to use the ssh-tunneling.

marked as duplicate by l0b0, Gilles ssh Oct 19 '14 at 13:05

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


Transparent Multi-hop SSH

If i understand your question correctly you're looking for a solution to ssh transparently into your lab server through the machine that's visible from the outside (let's call it gate).

As lbutlr mentioned first thing that comes to mind is to ssh into gate first and from there to ssh into your lab server. This works but it's not very convenient and you can't scp files directly between you and the server.

Much better solution: Check out this article on using ssh's ProxyCommand feature. With this you can instruct gate to act as a proxy so you just type ssh lab_server and it all works (even scp !).

  • Well, that was always an option, but I want to work off my local computer and not through the machine I can log into. – Akshya11235 Oct 20 '14 at 0:30
  • This is what ProxyCommand lets you do ! – lemonsqueeze Oct 20 '14 at 10:28

Your question seems unclear to me, and I'm not sure why you want ssh-tunneling. How do you login to the visible machine? If that is ssh, then can't you simply ssh from that machine to the internal machines?

For example, when I am away from home, I ssh to my home server, then from there I ssh to which is my desktop machine inside my home LAN. Doesn't that do what you need?

I can also ssh from my home server to my office servers, but cannot ssh to my office remotely otherwise, so I ssh to the home server (fixed IP) and then ssh to my office servers (fix IPs). From there, I can ssh to the machines on the office LAN.

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