Skip to content

Instantly share code, notes, and snippets.

@njbbaer
Created July 30, 2017 08:01
Show Gist options
  • Save njbbaer/744b0b3bb19bf41caf6657ccd6fca6bb to your computer and use it in GitHub Desktop.
Save njbbaer/744b0b3bb19bf41caf6657ccd6fca6bb to your computer and use it in GitHub Desktop.
autossh reverse tunnel systemd service file
[Unit]
Description=autossh reverse tunnel
After=network.target
[Service]
User=<local_user>
Environment="AUTOSSH_GATETIME=0"
ExecStart=/usr/bin/autossh -M 0 -o "ServerAliveInterval 30" -o "ServerAliveCountMax 10" -NR <remote_port>:localhost:<local_port> <remote_user>@<address>
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment