OPNsense
  • Home
  • Help
  • Search
  • Login
  • Register

  • OPNsense Forum »
  • Archive »
  • 15.7 Legacy Series »
  • Help on How to set Environment Variables for AUTOSSH
« previous next »
  • Print
Pages: [1]

Author Topic: Help on How to set Environment Variables for AUTOSSH  (Read 6486 times)

jimmy shao

  • Newbie
  • *
  • Posts: 33
  • Karma: 3
    • View Profile
Help on How to set Environment Variables for AUTOSSH
« on: July 23, 2015, 12:09:12 pm »
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!
Logged

franco

  • Administrator
  • Hero Member
  • *****
  • Posts: 13975
  • Karma: 1211
    • View Profile
Re: Help on How to set Environment Variables for AUTOSSH
« Reply #1 on: July 23, 2015, 12:41:13 pm »
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).
Logged

jimmy shao

  • Newbie
  • *
  • Posts: 33
  • Karma: 3
    • View Profile
Re: Help on How to set Environment Variables for AUTOSSH
« Reply #2 on: July 23, 2015, 01:22:02 pm »
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!
Logged

franco

  • Administrator
  • Hero Member
  • *****
  • Posts: 13975
  • Karma: 1211
    • View Profile
Re: Help on How to set Environment Variables for AUTOSSH
« Reply #3 on: July 23, 2015, 01:52:43 pm »
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.
Logged

jimmy shao

  • Newbie
  • *
  • Posts: 33
  • Karma: 3
    • View Profile
Re: Help on How to set Environment Variables for AUTOSSH
« Reply #4 on: July 23, 2015, 02:30:23 pm »
cool, get it.  :)

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

franco

  • Administrator
  • Hero Member
  • *****
  • Posts: 13975
  • Karma: 1211
    • View Profile
Re: Help on How to set Environment Variables for AUTOSSH
« Reply #5 on: July 23, 2015, 04:47:25 pm »
Okay, added privoxy, but 3 proxies in the packages repo ought to be enough now. ;)
Logged

franco

  • Administrator
  • Hero Member
  • *****
  • Posts: 13975
  • Karma: 1211
    • View Profile
Re: Help on How to set Environment Variables for AUTOSSH
« Reply #6 on: July 25, 2015, 10:09:22 pm »
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).
Logged

jimmy shao

  • Newbie
  • *
  • Posts: 33
  • Karma: 3
    • View Profile
Re: Help on How to set Environment Variables for AUTOSSH
« Reply #7 on: July 26, 2015, 10:01:33 am »
Great, Thanks!
Logged

  • Print
Pages: [1]
« previous next »
  • OPNsense Forum »
  • Archive »
  • 15.7 Legacy Series »
  • Help on How to set Environment Variables for AUTOSSH
 

OPNsense is an OSS project © Deciso B.V. 2015 - 2023 All rights reserved
  • SMF 2.0.19 | SMF © 2021, Simple Machines
    Privacy Policy
    | XHTML | RSS | WAP2