Skip to content

Instantly share code, notes, and snippets.

@ryan-beisner
Last active April 19, 2019 17:05
Show Gist options
  • Save ryan-beisner/ef0d5a7473c0962e2f9d692d356097cd to your computer and use it in GitHub Desktop.
Save ryan-beisner/ef0d5a7473c0962e2f9d692d356097cd to your computer and use it in GitHub Desktop.
Local laptop = FOO
Remote server = BAR
VM inside remote server = CAT
Let's say the BAR server has something listening on port 80 and you want to
get to that from FOO, your local laptop's web browser.
From FOO:
ssh ubuntu@BAR
(holding the right-shift key, hit tilde, capital C): ~C
You will see a "ssh>" console prompt appear, where you can make special
on-the-fly ssh commands. One of those could be a port forward!
-L 10080:CAT:80
Now on your local laptop, FOO, point your web browser at:
http://localhost:10080
And you should see the remote web server.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment