Created
January 12, 2012 00:05
-
-
Save yalab/1597598 to your computer and use it in GitHub Desktop.
SSH Tunnering
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
#!/bin/zsh | |
USER='yalab' | |
SOURCE_HOST='YOUR GLOBAL IP ADDRESS' | |
SOURCE_PORT=8888 | |
DEST_HOST='DESTINATION HOST IP ADDRESS' | |
DEST_PORT=22 | |
SSH_KEY='/home/yalab/.ssh/id_rsa' | |
sudo kill `ps ax | grep 'ssh -N'| awk '{print $1}'` | |
SSH_SERVER='ssh.yalab.org' | |
sudo ssh -N -L $SOURCE_HOST:$SOURCE_PORT:$DEST_HOST:$DEST_PORT $SSH_SERVER -l $USER -i $SSH_KEY & |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment