Configure permanent SSH tunnels
In /etc/systemd/system
create service files (e.g. sshrevHOST.service
) with this content:
[Unit]
Description=Reverse SSH connection HOST
After=network.target
[Service]
Type=simple
ExecStart=/usr/bin/ssh -g -N -T -o "ServerAliveInterval 10" -o "ExitOnForwardFailure yes" -R 52698:127.0.0.1:52698 HOST
Restart=always
RestartSec=5s
User=YOURUSERNAME
[Install]
WantedBy=default.target
Credit: https://blog.stigok.com/2018/04/22/self-healing-reverse-ssh-systemd-service.html