login about faq

I can easily create a tunnel using the terminal client like so:

$ sshg3 -L 8080:myserver:80

This will forward traffic from my local host on port 8080 to port 80 on myserver, however it requires that I leave this terminal connection open for the duration of the tunnel.

How can I have this tunnel created without having to always open a terminal connection?

asked Oct 07 '09 at 21:07

SSH%20KB's gravatar image

SSH KB ♦
509249246237

edited Oct 13 '09 at 10:34

Sami%20Lehtinen's gravatar image

Sami Lehtinen ♦
141128


One way to do this is by using static tunnels in Tectia Connection Broker.

Edit (or create) your broker configuration:

$HOME/.ssh2/ssh-broker-config.xml

You'll need to create a profile for the server that the tunnel will use:

<profile  id="id1" 
         user="joe" 
         host="myserver" />

Next you'll need to define a static tunnel specifying your tunnel parameters (the same values given on the command line above):

<static-tunnels>
 <tunnel type="TCP"
         listen-port="8080"
         dst-host="myserver"
         dst-port="80"
         allow-relay="no"
         profile="id1"/>
</static-tunnels>

And finally start the connection broker:

$ ssh-broker-g3

Now (as long as ssh-broker-g3 is running) when connecting, for example with a browser, to local port 8080 the tunnel will be opened to port 80 on host myserver without the need to start a separate terminal connection.

Since the application using the tunnel cannot provide the password for the SSH connection you'll also want to setup a non-interactive authentication method such as public key and unlock the key after starting the connection broker. See the command:

$ ssh-broker-ctl key-passphrase --help

Or alternatively use an empty-passphrase public key.

link

answered Oct 07 '09 at 21:24

Roman's gravatar image

Roman ♦♦
7735817

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×60
×7

Asked: Oct 07 '09 at 21:07

Seen: 5,830 times

Last updated: Oct 13 '09 at 10:34

All user contributed content licensed under the cc-by-sa license.
Powered by OSQA.