Unable to use autossh in background even with absolute path

Posted by Zagorax on Server Fault See other posts from Server Fault or by Zagorax
Published on 2013-10-18T09:18:06Z Indexed on 2013/10/18 9:59 UTC
Read the original article Hit count: 201

Filed under:

I would love to set autossh to run at boot adding it to /etc/rc.local.

This command works:

autossh -i /root/.ssh/id_rsa -R 2522:localhost:22 user@address

But, if I add the -f option

autossh -f -i /root/.ssh/id_rsa -R 2522:localhost:22 user@address

The ssh session is not started.

As you can see, I'm using an absolute path for my identity file, so this seems to be a different problem from the one stated here: autossh in background does not work

From /var/log/syslog:

Oct 18 11:08:39 raspberrypi autossh[2417]: starting ssh (count 1)
Oct 18 11:08:39 raspberrypi autossh[2417]: ssh child pid is 2418
Oct 18 11:08:39 raspberrypi autossh[2417]: ssh exited with status 0; autossh exiting

I'm using it with debian wheezy on a raspberry pi, autossh version 1.4c.

Could it be that it's passing the -f option to ssh instead?

© Server Fault or respective owner

Related posts about ssh