diff options
Diffstat (limited to '.config')
| -rw-r--r-- | .config/systemd/user/secure-tunnel@.service | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/.config/systemd/user/secure-tunnel@.service b/.config/systemd/user/secure-tunnel@.service new file mode 100644 index 0000000..f97f3ba --- /dev/null +++ b/.config/systemd/user/secure-tunnel@.service @@ -0,0 +1,23 @@ +[Unit] +Description=Setup a secure tunnel to %I +After=network.target + +# +# Add secure-tunnel@<name> file with necessary env vars: +# +#USER= # user to run the unit with +#REMOTE_PORT= # some port on the remote machine to forward to +#REMOTE_USER= # user on the remote machine +#TARGET_PORT= # ssh port of the target machine usually 22 +# +[Service] +User="${USER}" +EnvironmentFile=%h/.config/systemd/user/secure-tunnel@%i +ExecStart=/usr/bin/ssh -NT -o ServerAliveInterval=60 -o ExitOnForwardFailure=yes -R ${REMOTE_PORT}:localhost:${TARGET_PORT} ${TARGET} -l ${REMOTE_USER} + +# Restart every >2 seconds to avoid StartLimitInterval failure +RestartSec=5 +Restart=always + +[Install] +WantedBy=multi-user.target |
