ssh tunneling with -L only for localmachine
Sorry, this might have been answered before, but could not get the searchengine to search case sensitive for option -L instead of -l.
I have system A, system B and System C. A is my desktop. B and C are servers. I need to reach C directly from A, which I cannot due to routing issues (which I cannot remedy)
....If A drives with 50 mph and C with 70mph, when will they meet in the middle....
Blast, sorry, I went into math-problem-from-school mode ;-)
Resuming:
I can reach C when connecting first to B and then to C.
I know that I can use ssh to tunnel the connection with:
ssh -L 2222:C:22
executing it on B. This command does not work, to my surprise. I got to log in again to make it work.
ssh -L 2222:C:22 B
This then opens port 2222 on server B to point to port 22 on server C, which is exactly what I want, BUT:
I cannot find this port when connecting (and nmaping) from A. It is only reachable locally on B.
Netstat gives some clue:
tcp 0 0 serverB:2222 *:* LISTEN
So, somehow the service only listens for requests that originate from serverB directly. I notices that other services have a joker (i.e. *:ssh), which implies to me "from everywhere".
How can I get this thing to open up this tunnel also for external hosts?
Is there a way to execute the ssh tunnel without loging in again (giving the password and opening another shell)?
Cheers
Markus
|