- place the
autossh@.service
file in /etc/systemd/system - enable an instance -- suppose your remote host is called
frodo
then you might run:systemctl enable autossh@frodo
(do not use--now
here!) - now it is time to create an override specific to the instance, e.g. :
systemctl edit autossh@frodo.service
and adjust the following bunch of settings (commented out in the main unit template) like so:[Service] Environment=MONITOR_PORT=1023 Environment=REMOTE_PORT=1022
Environment=TARGET_USER=username