Skip to content

Instantly share code, notes, and snippets.

@rubinchyk
Forked from merevu/ssh_tunneling.sh
Created June 5, 2023 09:18
Show Gist options
  • Save rubinchyk/2ca15d6580a00f678d058d45979effb8 to your computer and use it in GitHub Desktop.
Save rubinchyk/2ca15d6580a00f678d058d45979effb8 to your computer and use it in GitHub Desktop.
ssh-tunneling
# local tunnel (for connecting remote from local)
ssh -f -N -L{LOCAL-PORT}:{DEST-IP}:{DEST-PORT} -l {JUMP-HOST-USER} {JUMP-HOST-IP}:{JUMP-HOST-PORT}
# reverse tunnel (for connecting local from remote)
ssh -f -N -R {LOCAL-PORT}:{DEST-IP}:{DEST-PORT} -l {LOCAL_USER} {LOCAL-IP}:{LOCAL-PORT}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment