From 9f0eb6fd7799cf8dbacfb2056d7e6cbd9519614d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iwan=20Cl=C3=A9ment?= Date: Fri, 3 May 2019 16:21:29 +0200 Subject: [PATCH] Ajout du fichier --- templates/secure-tunnel.service | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 templates/secure-tunnel.service diff --git a/templates/secure-tunnel.service b/templates/secure-tunnel.service new file mode 100644 index 0000000..4077b34 --- /dev/null +++ b/templates/secure-tunnel.service @@ -0,0 +1,19 @@ +# Must be sent to /etc/systemd/system +[Unit] +Description=Setup a secure tunnel to %I +After=network.target + +[Service] +User=ansusr +Environment="LOCAL_ADDR=localhost" +EnvironmentFile=/etc/default/secure-tunnel@%i +#ExecStart=/usr/bin/ssh -NT -o ServerAliveInterval=60 -o ExitOnForwardFailure=yes -R ${LOCAL_ADDR}:${LOCAL_PORT}:localhost:${REMOTE_PORT} ${TARGET} +#ExecStart=/usr/bin/ssh -p ${REMOTE_PORT} -NT -o StrictHostKeyChecking=no -o ServerAliveInterval=60 -o ExitOnForwardFailure=yes -R ${RTARGET_PORT}:localhost:22 ${TARGET} +ExecStart=/usr/bin/ssh -p ${REMOTE_PORT} -NT -o StrictHostKeyChecking=no -o ServerAliveInterval=60 -o ExitOnForwardFailure=yes -R ${RTARGET_PORT}:localhost:22 ${TARGET} + +# Restart every >2 seconds to avoid StartLimitInterval failure +RestartSec=5 +Restart=always + +[Install] +WantedBy=multi-user.target