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


[Service] Type=simple






' ' ' '

The autossh.sh script found at /var/tmp contains the following:

autossh [email protected] -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 protected] -p 22

I have also tried to add the "autossh [email protected] -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/)

  • It should be obvious. autossh .... isn't a absolute path. What it want is /path/to/autossh ..... Use which autossh to find the correct path to autossh.
    – Soren A
    Aug 9, 2019 at 9:15

1 Answer 1


I got it working thanks to Soren A! The error was that I needed the absolute path, which is set when you install autossh (/usr/bin/autossh), then I had to put the parameters afterwards. I found an example here that I copied: https://www.everythingcli.org/ssh-tunnelling-for-fun-and-profit-autossh/

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .