Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| docs:user-guide:services:autossh [2018/02/25 15:37] – ↷ Links adapted because of a move operation | docs:guide-user:services:ssh:autossh [2023/11/30 22:27] (current) – [Autossh] stokito | ||
|---|---|---|---|
| Line 11: | Line 11: | ||
| * [[https:// | * [[https:// | ||
| - | [[docs:user-guide: | + | [[docs: |
| ===== Use Case ===== | ===== Use Case ===== | ||
| Line 27: | Line 27: | ||
| ===== Configuration ===== | ===== Configuration ===== | ||
| - | Autossh is configured using the [[docs:user-guide: | + | Autossh is configured using the [[docs: |
| + | |||
| + | A typical configuration is as follows: | ||
| + | < | ||
| + | config autossh | ||
| + | option ssh '-i / | ||
| + | option gatetime ' | ||
| + | option monitorport | ||
| + | option poll ' | ||
| + | option enabled | ||
| + | </ | ||
| + | |||
| + | You need to replace ''/ | ||
| + | |||
| + | ===== Run as Service ===== | ||
| + | |||
| + | Autossh is often used as reverse proxy. It's probably because your ISP does not give you a public address or your router firewall policies. To make autossh run even when router restarts, your need to set up a service. | ||
| + | |||
| + | In ''/ | ||
| + | |||
| + | |||
| + | |||
| + | start_instance() { | ||
| + | local section=" | ||
| + | |||
| + | config_get ssh " | ||
| + | config_get gatetime " | ||
| + | config_get monitorport " | ||
| + | config_get poll " | ||
| + | config_get_bool enabled " | ||
| + | |||
| + | [ " | ||
| + | |||
| + | procd_open_instance | ||
| + | procd_set_param command / | ||
| + | procd_set_param respawn ${respawn_threshold: | ||
| + | procd_set_param env AUTOSSH_GATETIME=" | ||
| + | procd_set_param env AUTOSSH_POLL=" | ||
| + | procd_set_param env HOME="/ | ||
| + | procd_close_instance | ||
| + | |||
| + | |||
| + | For the first time you connect, you need to make sure that the server is in the trusted-host list, otherwise autossh will restart in a loop. | ||
| + | user.info autossh[17709]: | ||
| + | user.info autossh[17709]: | ||
| + | user.info autossh[17709]: | ||
| + | Just run an '' | ||
| + | Now you can enable the service by ''/ | ||
| ===== Fixes ===== | ===== Fixes ===== | ||
| To get ssh working you need to replace '' | To get ssh working you need to replace '' | ||