Skip to content

Instantly share code, notes, and snippets.

@beardymcbeards
Created December 5, 2015 04:48
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 beardymcbeards/339ec210797ad8970f06 to your computer and use it in GitHub Desktop.
Save beardymcbeards/339ec210797ad8970f06 to your computer and use it in GitHub Desktop.
[Unit]
Description=AutoSSH service for port x
After=network.target
[Service]
Environment="AUTOSSH_GATETIME=0"
ExecStart=/usr/bin/autossh -M 10861 -N -R <remote_port>:localhost:<forwarded_port> -o TCPKeepAlive=yes root@<dest> -p <ssh_port>
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment