Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^3: Tunneling DBD::mysql connections over SSH without using external programs

by salva (Monsignor)
on Apr 12, 2013 at 08:16 UTC ( #1028319=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Tunneling DBD::mysql connections over SSH without using external programs
in thread Tunneling DBD::mysql connections over SSH without using external programs

Then, there is only a realistic way to do that: write your own ssh implementation using Net::SSH2 able to redirect connections on a TCP port to the remote MySQL port trough SSH.

Then in your module run this proxy in a new thread or process.


Comment on Re^3: Tunneling DBD::mysql connections over SSH without using external programs
Download Code
Re^4: Tunneling DBD::mysql connections over SSH without using external programs
by wwinfrey (Novice) on Apr 12, 2013 at 15:52 UTC
    I concur, Salva, that this is the approach I need to take. I'm more inclined to use Net::OpenSSH as it seems the most portable (and, as was pointed out by Krambambuli below, all the other modules are wrappers to one degree or another for external binaries). In my response below I distilled the issue down to "How do you make DBI connect with DBD::mysql over Net::OpenSSH tunnels ?" and I suppose that's the crux of the challenge.
      Net::OpenSSH does not work on Windows.

      If you just want to run a tunnel, you could use the native ssh client from your OS on Unix and on Windows use PuTTY's plink which could be distributed with your module. IIRC, it doesn't have any dependency.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1028319]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (11)
As of 2014-09-17 08:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (70 votes), past polls