Solved

MySql client tunnel through intermediate host

Posted on 2014-02-24
5
98 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
IMAP copying tool 14 75
Unbreakable Oracle Linux 6.8 installation problem 9 62
VMware machine is not booting 6 122
Linux Server mapping drive using SSH key 9 50
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…
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

734 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