Skip to content

Instantly share code, notes, and snippets.

@zxkane
Created February 21, 2012 14:14
Show Gist options
  • Save zxkane/1876750 to your computer and use it in GitHub Desktop.
Save zxkane/1876750 to your computer and use it in GitHub Desktop.
automatically create ssh tunnel to forward port
ssh -q -N -o stricthostkeychecking=no -R 10002:localhost:22 -R 5900:localhost:5900 -R 6500:localhost:6500 [email protected]&
/usr/lib/autossh/autossh -M27002 -q -N -o stricthostkeychecking=no -R 10002:localhost:22 -R 5900:localhost:5900 -R 6500:localhost:6500 [email protected]&
su mylinuxaccount -c "export AUTOSSH_POLL=300;export AUTOSSH_GATETIME=0;/usr/lib/autossh/autossh -M27002 -q -N -o stricthostkeychecking=no -R 10002:localhost:22 -R 5900:localhost:5900 -R 6500:localhost:6500 [email protected]&"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment