I need to get an Ubuntu node to start an autossh tunnel to an SSH server when the node boots.
I have created a service with the following:
' ' ' '
Description=Autossh tunnel at boot
' ' ' '
The autossh.sh script found at /var/tmp contains the following:
autossh firstname.lastname@example.org -p 22
The error I get when I run "sudo systemctl status autossh.service" is: /etc/systemd/system/autossh.service:8: Executable path is not absolute: autossh email@example.com -p 22
I have also tried to add the "autossh firstname.lastname@example.org -p 22" command directly after the ExecStart command in the service.
As far as I can read on other posts is that ExecStart needs the absolute path to the script it is supposed to run, which is what I have included.
I have also tried to add both #!/bin/bash to the start of the ExecStart command, and also at the top of the autossh.sh script, but I get the same error no matter what I do.
I have also tried to place the autossh.sh script at another location (/home/username/)