From 06ba18ba891d52eb35811ce788b126f906378c28 Mon Sep 17 00:00:00 2001 From: tim Date: Mon, 4 Apr 2022 06:51:44 +0000 Subject: [PATCH] Add 'autossh-tunnel.service' --- autossh-tunnel.service | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 autossh-tunnel.service diff --git a/autossh-tunnel.service b/autossh-tunnel.service new file mode 100644 index 0000000..6990c56 --- /dev/null +++ b/autossh-tunnel.service @@ -0,0 +1,12 @@ +[Unit] +Description=autossh tunnel +After=network-online.target + +[Service] +User= # Make sure user has access to the relevant ssh key +ExecStart=/usr/bin/autossh -C -N -o "ServerAliveInterval 60" -o "ServerAliveCountMax 3" <-L, -R or -D port forward> -M 2000 @ -i /home//.ssh/ +# Add "GatewayPorts yes" to the server's sshd_config if you want external access to remote ssh port forwards +# Example port forward remotley accessing a computer behind a NAT/firewall: -R 2222:127.0.0.1:22 + +[Install] +WantedBy=multi-user.target \ No newline at end of file