Created
December 18, 2018 05:49
-
-
Save itdaniher/6e21c6454d9faffce49d6d5690138c82 to your computer and use it in GitHub Desktop.
sshtunnel service
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
REMOTE_SSH_PORT_TO_BIND=8192 | |
REMOTE_SSH_KEY_FULLPATH=/etc/sshtunnel.privkey | |
REMOTE_SSH_IP=255.255.255.255 | |
REMOTE_SSH_USER=root |
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
[Unit] | |
Description=SSH Tunnel | |
After=network.target | |
[Service] | |
EnvironmentFile=/etc/sshtunnel.conf | |
Restart=always | |
RestartSec=20 | |
User=root | |
ExecStart=/usr/bin/ssh -v -NT -o StrictHostKeyChecking=no -o ServerAliveInterval=60 -o ExitOnForwardFailure=yes -R 127.0.0.1:${REMOTE_SSH_PORT_TO_BIND}:127.0.0.1:22 -l ${REMOTE_SSH_USER} -i ${REMOTE_SSH_KEY_FULLPATH} ${REMOTE_SSH_IP} | |
[Install] | |
WantedBy=multi-user.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment