Skip to content

Instantly share code, notes, and snippets.

@mattb
Created January 16, 2014 20:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattb/8462540 to your computer and use it in GitHub Desktop.
Save mattb/8462540 to your computer and use it in GitHub Desktop.
description "autossh tunnel"
author "Joni Kähärä "
start on (local-filesystems and net-device-up IFACE=eth0 and net-device-up IFACE=eth1) # assuming we have multiple interfaces
stop on runlevel [016]
respawn
respawn limit 5 60
exec autossh -M 0 -N -R 10000:192.168.1.1:22 -o "ServerAliveInterval 60" -o "ServerAliveCountMax 3" -o "StrictHostKeyChecking=no" -o "BatchMode=yes" -i /home/user/.ssh/id_rsa username@hostname
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment