Thursday, July 9, 2009

ssh tunnels

In many cases, development projects are on the same data center, and the server product is on the other. And often it is necessary to provide the link between the test and product servers.

Simply ssh tunnel:

ssh -p40088 -2 -N -C -f -L 172.11.5.58:3307:10.20.1.103:3306 tunnel@x.x.x.x

-p40088 - gateway to production DC ssh port
172.11.5.58:3307 - host:port on local server
10.20.1.103:3306 - host:port on remote server
tunnel@x.x.x.x - username@host of gateway to production DC


And now when I connect to port 3307 on local server I get connect with 10.20.1.103:3306 on production server.

No comments:

Post a Comment