[Unit] Description=Setup a secure tunnel to %I After=network.target [Service] Environment="AUTOSSH_GATETIME=0" EnvironmentFile=/etc/default/secure-tunnel@%i ExecStart=/usr/bin/autossh -M 0 -o "ServerAliveInterval 30" -o "ServerAliveCountMax 3" -o "ExitOnForwardFailure yes" -NR ${JH_PORT}:localhost:"${HTE_PORT}" "${USER}"@"${TARGET}" User=autossh Restart=on-failure RestartSec=5s [Install] WantedBy=multi-user.target