Help on How to set Environment Variables for AUTOSSH

Started by jimmy shao, July 23, 2015, 12:09:12 PM

Previous topic - Next topic
Hi, guys.

I am using AUTOSSH to keep SSH connection with a server outside. There is some Environment Variables for AUTOSSH, I just don't know how to set it up.

I was moved from openWRT. which have a clear instruction about this(http://wiki.openwrt.org/doc/howto/autossh), they use UCI to unify all the config files.

Any one can tell me where is the Config file of AutoSSH in OPNsense? Thanks!

The script that launches sshd is /usr/local/etc/rc.sshd and that is probably what you need to modify in order to bring in our environment variables.

It will be very hard to bring autossh to the default installation and/or play nice with the current sshd design (you can disable sshd and do it manually maybe).

Hi, Franco

thanks for the rapid reply.

I think there is maybe a misunderstanding here, AUTOSSH only work with SSH client, it has no related with SSHD.
The official website of AUTOSSH is here: http://www.harding.motd.ca/autossh/

So, Franco, would you please help on the topic?
Where is the config file or how to set the Environment Variables for AUTOSSH?

Really Appreciate!

Okay, sorry, I only skimmed the manual for autossh. What I'll do for 15.7.4 is add autossh to the available packages, so when it is released you can do:

# pkg install autossh

Then we'll have to look at how to invoke it properly within OPNsense.

cool, get it.  :)

BTW, if privoxy can be add to the available packages will be more great.

Okay, added privoxy, but 3 proxies in the packages repo ought to be enough now. ;)

So I fixed autossh for our firmware and it's in there now:

# pkg install autossh

You can drop a sh-compatible script into /etc/rc.conf.d, e.g. /etc/rc.conf.d/autossh that can set environment variables and start up autossh according to your needs. Those get executed on bootup (only).