Last active
April 4, 2017 12:09
-
-
Save eulersson/4999817449c26f193c780932e3336c60 to your computer and use it in GitHub Desktop.
SSH Tunel
This file contains 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
# /////////////////////////////////////// | |
# 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. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
46.101.1.33