Skip to content

Instantly share code, notes, and snippets.

@bardimnik
Forked from mateobur/autossh.service
Created May 12, 2019 12:17
Show Gist options
  • Select an option

  • Save bardimnik/0e931c41edc21f25bfc807dabf8c2a2c to your computer and use it in GitHub Desktop.

Select an option

Save bardimnik/0e931c41edc21f25bfc807dabf8c2a2c to your computer and use it in GitHub Desktop.
autossh ubuntu systemd
[Unit]
Description=Autossh Tunnel
Wants=network-online.target
After=network-online.target
[Service]
User=<user>
Type=simple
ExecStart=/usr/bin/autossh -M 20000 -N <host> -R 0.0.0.0:30000:localhost:22
Restart=always
RestartSec=60s
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment