Skip to content

Instantly share code, notes, and snippets.

@kronoc
Last active May 2, 2019 15:06
Show Gist options
  • Save kronoc/c5f7650d2d73dd6c9c343534caaaeb33 to your computer and use it in GitHub Desktop.
Save kronoc/c5f7650d2d73dd6c9c343534caaaeb33 to your computer and use it in GitHub Desktop.
# for rasbian
# sudo cp autossh.service /etc/systemd/system/ ; sudo systemctl enable autossh.service ; sudo reboot
[Unit]
Description=Keep ssh tunnel to specified remote host open
After=network.target
[Service]
User=USERNAME_TO_RUN_SSH_UNDER
ExecStart=/usr/bin/autossh -N tunnel
RestartSec=5
Restart=always
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment