Created
March 6, 2017 13:46
-
-
Save huyby/b32322cfe9430de144444539118d1abd to your computer and use it in GitHub Desktop.
SSH port forwarding commands; useful for forwarding a remote database connection over SSH in combination with other configurations like a jump host (bastion)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Overview on SSH port forwarding: http://blog.trackets.com/2014/05/17/ssh-tunnel-local-and-remote-port-forwarding-explained-with-examples.html | |
# Example of MySQL database connection tunnel using a jump host | |
ssh -F ./ssh.cfg -nNT -L 33060:localhost:3306 remotehost | |
# ./.ssh.cfg contents | |
Host bastion | |
Hostname 8.8.8.8 | |
User bastion-user | |
Host 10.0.1.* | |
User internal-host-user | |
ProxyJump bastion |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment