J. Bakshi | 27 Jun 2012 16:37
Picon

how to open ssh tunnel port ?


Dear list,

I have made a successful ssh tunnel between two pcs A and B.
A is running mysql and B have the tunnel with A , so that B
can access that remote mysql with its local port 3360. Everything
is fine......

But B is bind the port with localhost only, hence no one can access
B's 3360 port. How can B open the port so that others can also
use the 3360 port on B which is actually tunneled with A ?

<A running mysql> ------tunnel-----<B localhost:3360>
but <c> can't see 3360 on <B>

Thanks

Karl E. Jorgensen | 27 Jun 2012 16:51
Favicon

Re: how to open ssh tunnel port ?

On Wed, Jun 27, 2012 at 03:37:30PM +0100, J. Bakshi wrote:
> 
> Dear list,
> 
> I have made a successful ssh tunnel between two pcs A and B.
> A is running mysql and B have the tunnel with A , so that B
> can access that remote mysql with its local port 3360. Everything
> is fine......
> 
> But B is bind the port with localhost only, hence no one can access
> B's 3360 port. How can B open the port so that others can also
> use the 3360 port on B which is actually tunneled with A ?
> 
> <A running mysql> ------tunnel-----<B localhost:3360>
> but <c> can't see 3360 on <B>

>From the ssh man page:

     -L [bind_address:]port:host:hostport

or alternatively: use the -g option..

But...

It sounds like you're using this to bypass a firewall somewhere? If
so, beware: MySQL traffic is NOT encrypted so any usernames/passwords
sent to mysql are easily exposed.  And there's bound to be security
vulnerabilities in the MySQL protocol too - it is not designed to be
hardened.

(Continue reading)

Laurence Hurst | 27 Jun 2012 16:56
Picon
Favicon

Re: how to open ssh tunnel port ?

On 27/06/2012 15:37, J. Bakshi wrote:
>
> Dear list,
>
> I have made a successful ssh tunnel between two pcs A and B.
> A is running mysql and B have the tunnel with A , so that B
> can access that remote mysql with its local port 3360. Everything
> is fine......
>
> But B is bind the port with localhost only, hence no one can access
> B's 3360 port. How can B open the port so that others can also
> use the 3360 port on B which is actually tunneled with A ?
>
> <A running mysql>  ------tunnel-----<B localhost:3360>
> but<c>  can't see 3360 on<B>
>
> Thanks
>
>

Hi,

Your current ssh command (assuming you are connection from B to A) 
presumably looks something like:

ssh -L 3360:localhost:3306 A

According to the ssh man page (try running "man ssh" and read the bit 
about the '-L' argument), you can specify the bind address as part of 
that argument. Basically you should end up with something like this:
(Continue reading)

J. Bakshi | 28 Jun 2012 10:39
Picon

Re: how to open ssh tunnel port ?

On Wed, 27 Jun 2012 15:56:01 +0100
Laurence Hurst <L.A.Hurst <at> lboro.ac.uk> wrote:

[.......]

> 
> ssh -L 192.168.0.1:3360:localhost:3306 A
> 
> where '192.168.0.1' is the ip address you want to bind to (i.e. the ip 
> address of eth0, or whichever interface you want to use). The same 
> method applies if you are using -R to create the tunnel the other way - 
> again read the manual page, it's there to help you!

[.............]

Thanks


Gmane