Page 1 of 1

problem with SSH tunneling

PostPosted: Tue May 15, 2012 10:57 am
by demeus1985
Hi!

I started using recently and it is pretty cool, so congrats!

I am having a little problem stablishing a SSH tunnel. After configuring it I get the following exception:

Can't initialize tunnel
Cannot establish tunnel
PortForwardingL: local port XXX.XXX.XXX.XXX:P cannot be bound.
Cannot assign requested address: JVM_Bind


I am running in Windows 7 x64 and the connection is also being established using a VPN. When doing the same thing with PuTTY works perfect.

Am I missing some configuration here? Do you know which is the problem?


Thanks in advance,

Jorge

Re: problem with SSH tunneling

PostPosted: Tue May 15, 2012 1:20 pm
by Serge
Hi!

If you work thru SSH tunnel then set server host (on main connection configuration page) to "localhost". Real database host should be set in tunnel configuration.
Maybe its a little bit confusing and not very obvious, I agree :) But connection configuration remains the same as if you'd use third-part software to establish connection.

Thanks!

Re: problem with SSH tunneling

PostPosted: Tue May 15, 2012 1:32 pm
by Serge
Maybe this issue should be qualified as bug.
Probably dbeaver should ignore database host value and always forward to localhost. Or it would confuse users even more?..

Re: problem with SSH tunneling

PostPosted: Tue May 15, 2012 4:11 pm
by demeus1985
Hi Serge,

Thanks for your answer.

In my opinion, I suggest that the less confusing way would be to work in the same way as DBVisualizer does:

In our situation, we have to manage two servers (ips/hostnames). The database server, that should be configured in the main connection tab (where all the information to the database is set). On the other hand, the SSH host, through which we are establishing the tunnel, in the "tunneling" configuration dialog. This SSH host, is not localhost. Why are you saying that we should use localhost?

As a workaround, I had to use PuTTY to establish the tunnel through the SSH host and, in this case, yes, I had to point the main connection tab to localhost. But I think that DBeaver configuration should be independent from third party software.

Regards,

Jorge

Re: problem with SSH tunneling

PostPosted: Thu May 17, 2012 8:25 am
by Serge
Hi Jorge,

Sure, SSH host is not a localhost, it doesn't make sence to make tunnels on local machine :)
I mean you always forward port from some SSH host TO localhost. And when JDBC driver connects to database it connects to some port on localhost which then forwarded to some remote host.

Anyway, I made some fixes in tunnel configuration. These fixes should make configuration more "user friendly". I believe new version (1.5.6) will be released on the next week.

Thanks!

Re: problem with SSH tunneling

PostPosted: Mon May 21, 2012 9:05 am
by demeus1985
Hi again Serge,

Thanks for your answer. I think that I may misunderstood something from your explanation.

This is the configuration I think I should do:

General Tab: All DB configuration: ip, port, schema, login and password
Tunneling dialog: ip of the system through which I'm going to establish the tunnel, port 22 and login and password for this system.

What I understood from what you have previously said was:

General Tab: localhost as ip or SSH tunneling system IP. port, login and password of SSH system?
Tunneling dialog: DB ip, DB port, DB login and password.

Anyway, I tried several combinations but none of them was aparently correct :)

I look forward to test this in the new release. Will it be then configured as I said?

Thanks,

Jorge

Re: problem with SSH tunneling

PostPosted: Mon May 21, 2012 11:43 am
by Serge
Hmm. Thats strange.
At the moment SSH tunnel configuration is very similar to the same configuration in DBVis or Navicat or other universal tools.

In database settings tab (General tab) set database port, database name, user/password as if you connect to it without a tunnel. The only difference is host name - set it to "localhost".
In SSH tunnel configuration window set you SHH host name, port (22) and your user/password on that host.

Hope it'll help :)

PS New version will be released 22 or 23 May, fix will allow you to set database host name in General tab.

Re: problem with SSH tunneling

PostPosted: Thu May 24, 2012 2:58 pm
by demeus1985
Hi Serge,

I've just downloaded the new version and it works as I expected. It is great!

Thank you very much!

Jorge