A little script to make autossh works as a service.
To use:
- Install
autossh
andnc
first. - Copy files to
/opt/ssh_redirect
,or somewhere you like, but remember to change the script path in service file. - Copy the example config, for example here "website.conf" and edit it.
- Copy the ssh_redirect@.service to /lib/systemd/system and execute
systemctl daemon-refresh
. - Enable or start your daemon using
systemctl enable|start ssh_redirect@website
.
For details, see the example.conf
.