From e25b133483f92e9ab498167df07b955cf697252e Mon Sep 17 00:00:00 2001 From: Simon Rieger Date: Sun, 15 Jan 2017 16:14:53 +0100 Subject: [PATCH] ssh tunnel vom server einrichten mit: ssh-keygen -t rsa -b 4096 ssh-copy-id -i ~/.ssh/id_rsa.pub user@server oder cat id_rsa.pub | ssh server 'cat>> ~/.ssh/authorized_keys' --- sshtunnel1.service | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 sshtunnel1.service diff --git a/sshtunnel1.service b/sshtunnel1.service new file mode 100644 index 0000000..712dc1e --- /dev/null +++ b/sshtunnel1.service @@ -0,0 +1,15 @@ +[Unit] +Description=SSH Tunnel +ConditionPathExists=|/usr/bin +After=network.target + +[Service] +User=simono41 +ExecStart=/usr/bin/ssh -NTC -o ServerAliveInterval=60 -o ExitOnForwardFailure=yes -o StrictHostKeyChecking=no -i /home/simono41/.ssh/id_rsa -L 12345:localhost:22 pi@mgwywbvcwmot7vir.myfritz.net + +# Restart every >2 seconds to avoid StartLimitInterval failure +RestartSec=3 +Restart=always + +[Install] +WantedBy=multi-user.target