Skip to content

Instantly share code, notes, and snippets.

@chriszarate
Created July 15, 2015 03:39
  • Star 2 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save chriszarate/bc34b7378d309f6c3af5 to your computer and use it in GitHub Desktop.
VNC over SSH via bastion
# You want to VNC to Box A but you don't have access to it
# over public Internet. You do have SSH access to Box B in
# the same private network.
# firewall
# ┌─────┐ ╏╏ ┌─────┐
# │ You │──SSH──╏╏────│ B │ bastion
# └─────┘ ╏╏ └──┬──┘
# ╏╏ SSH
# ╏╏ ┌──┴──┐
# ╏╏ │ A │ VNC target
# ╏╏ └─────┘
# On Box B (via ssh)
ssh -N -L 5001:localhost:5900 user@boxA
# On your local machine
ssh -N -L 5900:localhost:5001 boxB
# On your local machine, you can now VNC to Box A with
# vnc://localhost (using Safari/Finder/VNC app)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment