Created
May 17, 2023 18:04
-
-
Save vshmoylov/444b919f1a28c838195642df513dd5b2 to your computer and use it in GitHub Desktop.
ssh tunnel as systemd 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
[Unit] | |
Description=Persistent SSH Tunnel from port XXXX on this server, docker ip to port localhost:YYYY on example.com server (local port forwarding) | |
After=network.target | |
[Service] | |
Restart=on-failure | |
RestartSec=5 | |
ExecStart=/usr/bin/ssh -NTC -o ServerAliveInterval=60 -o ExitOnForwardFailure=yes -L 172.17.0.1:XXXX:127.0.0.1:YYYY example.com | |
[Install] | |
WantedBy=multi-user.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment