Add 'autossh-tunnel.service'
This commit is contained in:
parent
0eedc83163
commit
06ba18ba89
|
@ -0,0 +1,12 @@
|
||||||
|
[Unit]
|
||||||
|
Description=autossh tunnel
|
||||||
|
After=network-online.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
User=<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 <user>@<host> -i /home/<user>/.ssh/<ssh_key>
|
||||||
|
# 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
|
Loading…
Reference in New Issue