[CentOS] ssh port forwarding

We Are Here support at wearehere.net
Thu Jul 12 17:30:33 UTC 2012


At 18:20 12/07/2012, you wrote:

Hi Doug,

>I am having a problem with setting up port forwarding from one of our local
>CentOS machines to an AWS EC2 instance. We are wanting to make mysql
>connections over an ssh tunnel.
>
>In this case, lets say that hostA is our local machine, and hostB is the
>Amazon EC2 instance. I have tried several different variations (that I have
>found from google searching), including:
>from hostA: ssh -L 22222:hostB:3306 user at hostB
>from hostA: ssh -L 22222:localhost:3306 user at hostB
>from hostA: ssh -L 22222:hostB:3306 user at localhost
On HostA run the following within a screen session;

ssh user at hostB -L 22222:127.0.0.1:3306

Hope this helps.

regards Tim
Tim D'Cruz




More information about the CentOS mailing list