# روی سرورِ بکاپ (۲۴۷). تونلِ SSH از 127.0.0.1:15440ِ این‌جا به Postgresِ ما روی ۲۴۹ (127.0.0.1:5440). # کلید در authorized_keysِ ۲۴۹ با restrict,port-forwarding,permitopen="127.0.0.1:5440" محدود است: # با آن نه شِل باز می‌شود نه پورتِ دیگری. ترافیک در شبکه‌ی داخلی (192.168.200.x) می‌ماند. [Unit] Description=Zareian MathApp: SSH tunnel to the app Postgres on 249 After=network-online.target Wants=network-online.target [Service] User=administrator ExecStart=/usr/bin/ssh -N -i /home/administrator/.ssh/zareian_pgbackup \ -o BatchMode=yes -o ExitOnForwardFailure=yes \ -o ServerAliveInterval=15 -o ServerAliveCountMax=3 \ -L 127.0.0.1:15440:127.0.0.1:5440 administrator@192.168.200.164 Restart=always RestartSec=10 [Install] WantedBy=multi-user.target