I have a machine behind my firewall. When I turn this machine on, I want it to make a reverse ssh connection to another machine, which is available from outside the firewall. I use autossh to make and maintain the connection, and systemd to start the task on boot. The systemd unit file looks like:
cat /etc/systemd/system/autossh.service
[Unit]
Description=Keeps a tunnel to 'MYEXTERNALDOMAIN.com' open
After=network-online.target
[Service]
Environment=AUTOSSH_GATETIME=0
ExecStart=/usr/bin/autossh -M 0 -N -q -o "ServerAliveInterval 60" -o "ServerAliveCountMax 3" -i /root/.ssh/id_rsa -R 22222:localhost:22 -p 23 USER@MYEXTERNALDOMAIN.com
[Install]
WantedBy=multi-user.target
And then do:
systemctl start autossh
systemctl enable autossh
PostgreSQL Extensions - A Deeper Look
-
My slides from my session "PostgreSQL Extensions - A Deeper Look" at
PostgresOpen 2019 and PostgresConf SV 2019
* PostgreSQL Extensions: A deeper look ...
5 years ago