Skip to content

Instantly share code, notes, and snippets.

@eulersson
Last active April 4, 2017 12:09
Show Gist options
  • Save eulersson/4999817449c26f193c780932e3336c60 to your computer and use it in GitHub Desktop.
Save eulersson/4999817449c26f193c780932e3336c60 to your computer and use it in GitHub Desktop.
SSH Tunel
# ///////////////////////////////////////
# SSH Tunneling
# How it looks like:
# [UNI]<-->[CLOUD (relay)]<-->[CLIENT]
# UNI: localhost (127.0.0.1)
# CLOUD: posvec.xyz (46.101.1.33)
# CLIENT: any IP you have or connect from
# ///////////////////////////////////////
# Steps:
# 1. Serve shell local port on UNI (port 22) to CLOUD (port 8889)
ssh -N -R 8889:127.0.0.1:22 lola@posvec.xyz
# 2. Connect from anywhere to UNI using CLOUD as relay
ssh iXXXXXXX@posvec.xyz
# 3. If you will be using the command so many times add it as an alias in your ~/.bashrc file:
alias startTunnel='ssh -N -R 8889:127.0.0.1:22 guest@46.101.1.33'
# Problems:
# - Connection must be kept alive, otherwise after time with no operations the connection is lost and you get the Broken pipe problem.
@eulersson
Copy link
Author

46.101.1.33

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment