Last active
January 8, 2018 15:23
-
-
Save j18e/c030eb60a447161632b628be0b9ee680 to your computer and use it in GitHub Desktop.
SSH Port Forwarding
This file contains hidden or 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
# $HOME/.ssh/config | |
Host example-forward | |
HostName bastion.example.com | |
ForwardAgent yes | |
ForwardX11 yes | |
LocalForward 9090 app-0.example.local:8080 | |
# this allows you to run `ssh example-forward` | |
# you'll get an SSH session but more importantly, | |
# requests on localhost:9090 will be forwarded past the bastion onto its local network | |
# and finally to port 8080 of the app-0 server | |
# maybe to access the web console of app-0 you'll need to address it as app.example.local | |
# in which case you should add a line to /etc/hosts: | |
# 127.0.0.1 app.example.local | |
# then go on a web browser to http://app.example.local:9090 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment