Created
April 11, 2018 07:31
-
-
Save xopr/f252219c2fab68a85086d95baf5b0148 to your computer and use it in GitHub Desktop.
Use autossh and screen to create a tunnel back to the local host publicly available on 'remote'
This file contains hidden or 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 | |
echo Setting up remote tunnel in screen session | |
screen -dmS tunnel autossh -N -R *:2222:localhost:22 -i .ssh/cypher tunnel@remote -p22 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Check if screen session for tunnel already exists before executing: