Skip to content

Instantly share code, notes, and snippets.

@ericfourrier
Last active April 25, 2016 23:05
Show Gist options
  • Save ericfourrier/07159123b9008c7951ec to your computer and use it in GitHub Desktop.
Save ericfourrier/07159123b9008c7951ec to your computer and use it in GitHub Desktop.
# You need a server acessible from the client and server (aws instance for example accessible on port ssh 22 )
# install autossh ( apt-get install autossh)
# on the local machine (raspberry pi )
autossh -M 10001 -f -N -R 10000:localhost:22 user@serverip
# -n Redirects stdin from /dev/null (actually, prevents reading from stdin). This must be used when ssh is run in the background
# -N Do not execute a remote command. This is useful for just forwarding ports
# -T Do not allocate a pseudo-tty on the remote system
# -R Set up the tunnel as a reverse tunnel.
# on the server :
ssh -p 10000 root@localhost
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment