Last active
July 11, 2019 09:19
-
-
Save k37y/32df9b964cef8e5f06deb6dc8b0a5509 to your computer and use it in GitHub Desktop.
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=Setup a secure tunnel to %I | |
After=network-online.target | |
[Service] | |
User=kevy | |
EnvironmentFile=/etc/default/ssht@%i | |
ExecStart=/usr/bin/ssh -i /key.pem -NT -o ForwardX11=yes -o ServerAliveInterval=60 -o ExitOnForwardFailure=yes -R ${REMOTE_PORT}:127.0.0.1:${LOCAL_PORT} ubuntu@${TARGET} | |
# Restart every >2 seconds to avoid StartLimitInterval failure | |
RestartSec=5 | |
Restart=always | |
[Install] | |
WantedBy=multi-user.target |
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
TARGET=<Instance IP> | |
LOCAL_PORT=22 | |
REMOTE_PORT=2222 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment