[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