Solved

MySql client tunnel through intermediate host

Posted on 2014-02-24
5
91 Views
Last Modified: 2016-06-03
Situation:

Hosts A,B,C

Host A is where my MySql client resides. Host C is the MySql server. Host B is a host to which i have ssh access, which has the benefit of a fixed IP, which is not the case with host A. I'd like only one host to be permitted remote MySql access to C, namely A. I was rather hoping this could be made possible by tunneling through B. Is it? I want to be able to query C from A.

Host B does not have a MySql client and i really need it to stay that way.
0
Comment
Question by:CEHJ
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 29

Accepted Solution

by:
serialband earned 350 total points
ID: 39884272
You should be able to use ssh on Host B to map the remote port of host C to the local port on Host B.

ssh -T -N -L 3306:localhost:3306 Host_C

You could also remap the port on Host B to another port.
ssh -T -N -L 3307:localhost:3306 Host_C


You might even want to run another tunnel from your system, Host A, to Host B to keep the traffic encrypted.

ssh -T -N -L 3308:localhost:3307 Host_B

Then you just connect you MySQL cilent to port 3308 on your local system.   I used different ports to show you how to set it up.
0
 
LVL 86

Author Comment

by:CEHJ
ID: 39884311
Thanks - that's interesting. Normally B's firewall is very tight. Is it the case that since we're tunneling through ssh, B:3306 is not going to have a firewall problem for me connecting from A?
0
 
LVL 29

Expert Comment

by:serialband
ID: 39884756
What ports are open on B?  You can remap that port to anything.
0
 
LVL 86

Author Comment

by:CEHJ
ID: 39885139
From memory, 53, 139 & 22
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

As a database administrator, you may need to audit your table(s) to determine whether the data types are optimal for your real-world data needs.  This Article is intended to be a resource for such a task. Preface The other day, I was involved …
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question