Created
February 14, 2015 14:33
-
-
Save agea/0631f630bbc3e24f725f to your computer and use it in GitHub Desktop.
reverse ssh persistent tunnel
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/bash | |
set +e | |
SSH_OPTIONS=" -i /home/pi/.ssh/id_rsa" | |
# Always assume initial connection will be successful | |
#export AUTOSSH_GATETIME=0 | |
# Disable echo service, relying on SSH exiting itself | |
export AUTOSSH_PORT=0 | |
#to test, use (check out man ssh for explanation of options: | |
#autossh -vv -- $SSH_OPTIONS -o 'ControlPath none' -R 31416:localhost:22 pi@agea.noip.me -N | |
#once proven, use (and rem out previous command): | |
autossh -f -- $SSH_OPTIONS -o 'ControlPath none' -g -R 0.0.0.0:31416:localhost:22 pi@168.235.66.155 -N 2> /dev/null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment