Skip to content

Instantly share code, notes, and snippets.

@pierdom
Last active September 7, 2017 07:56
Show Gist options
  • Save pierdom/02cff23c1e6a4fe92e821b772e360ea8 to your computer and use it in GitHub Desktop.
Save pierdom/02cff23c1e6a4fe92e821b772e360ea8 to your computer and use it in GitHub Desktop.
[SSH tunnels on background] #linux #macosx #sysadmin #networking

Background tunnel (it works with -D for creating a SOCKS proxy, as well)

ssh -f -N -L 2222:localhost:22 username@serveraddr

To avoid connection timeout, install autossh (which uses the very same syntax of the standard ssh). Then:

autossh -f -N -L 2222:localhost:22 username@serveraddr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment