Skip to content

Instantly share code, notes, and snippets.

@cpswan
Created May 3, 2019 14:59
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 cpswan/f06ea6eb399ff6fe119248734201a346 to your computer and use it in GitHub Desktop.
Save cpswan/f06ea6eb399ff6fe119248734201a346 to your computer and use it in GitHub Desktop.
systemd service description for autossh tunnel within a screen
[Unit]
Description=AutoSSH tunnel in a screen
After=network-online.target
[Service]
User=changeme
Type=simple
Restart=on-failure
RestartSec=3
ExecStart=/usr/bin/screen -DmS tunnel1 /usr/lib/autossh/autossh -M 20020 -D 0.0.0.0:12345 me@mybox.there.com
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment