shell-scripte-code/sshtunnel1.service

17 lines
529 B
SYSTEMD
Raw Permalink Normal View History

[Unit]
Description=SSH Tunnel
ConditionPathExists=|/usr/bin
After=network.target
2017-05-21 02:56:22 +02:00
# host --> client; Weiterleitung von Port 22 auf dem lokalen System an den Webserver (Port 12345) auf server:
[Service]
2017-02-05 00:10:21 +01:00
User=root
ExecStart=/usr/bin/ssh -NTC -o ServerAliveInterval=60 -o ExitOnForwardFailure=yes -o StrictHostKeyChecking=no -i /root/.ssh/id_rsa -L 12345:localhost:22 root@mgwywbvcwmot7vir.myfritz.net
# Restart every >2 seconds to avoid StartLimitInterval failure
RestartSec=3
Restart=always
[Install]
WantedBy=multi-user.target