Created
December 22, 2017 11:40
-
-
Save guettli/55a7576fa00ece559c91e16d48fa3951 to your computer and use it in GitHub Desktop.
Reliable persistent SSH-Tunnel via systemd (not autossh)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Reliable persistent SSH-Tunnel via systemd (not autossh) | |
# | |
[Unit] | |
Description=Tunnel for %i | |
After=network.target | |
[Service] | |
User=tunnel | |
ExecStart=/usr/bin/ssh -o "ExitOnForwardFailure yes" -o "ServerAliveInterval 60" -N tunnel@%i | |
Restart=always | |
RestartSec=5s | |
StartLimitInterval=0 | |
[Install] | |
WantedBy=multi-user.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment