Monday, November 9, 2015

Creating a SSH tunnel

Saving tip for the future. To access your remote sever (DB server in this case) over a SSH tunnel, few steps needed:

1. Create/edit ~/.ssh/config
Add following to proxy all connections using the jump server to host foo
Host foo.remote.com
 ProxyCommand ssh username@jump.remote.com exec nc %h %p 2> /dev/null



2. Create tunnel to target on port 3306 which will appear as 7777 on localhost
ssh -C -L 7777:target.remote.com:3306 username@foo.remote.com dstat 10

3. Use SQL developer/workbench to now connect to localhost 7777

foo and remote could be same or different server above.
Good luck.

1 comment:

kalai said...

Thank you for taking the time to provide us with your valuable information. We strive to provide our candidates with excellent care and we take your comments to our mind.As always, we appreciate your confidence and trust in us.




Dot Net training