Created
June 29, 2016 11:59
-
-
Save JonathanPorta/0e0fd08f51f5a5ec7a1c5560ca224d03 to your computer and use it in GitHub Desktop.
ssh-tunnel.service
This file contains hidden or 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
# A reverse ssh tunnel systemd service. | |
[Unit] | |
Description=Create an SSH tunnel for the MTNA service | |
ConditionPathExists=|/usr/bin | |
After=network.target | |
[Service] | |
User=stanparker | |
Environment="AUTOSSH_DEBUG=True" | |
Environment="AUTOSSH_GATETIME=0" | |
ExecStart=/usr/bin/autossh -M 0 -N -T -q -o ServerAliveInterval=30 -o ServerAliveCountMax=3 -R 22222:localhost:22 [email protected] | |
# Restart every >2 seconds to avoid StartLimitInterval failure | |
RestartSec=3 | |
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