Ajout du fichier
This commit is contained in:
19
templates/secure-tunnel.service
Normal file
19
templates/secure-tunnel.service
Normal file
@@ -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
|
||||||
Reference in New Issue
Block a user