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
Setting up PostgreSQL 12 Beta 3 for Testing in Amazon RDS
-
One of the amazing things about the PostgreSQL community is launching
releases like clockwork. On 8/8/2019 the PostgreSQL community not only
launched the ...
5 years ago