dots/configs/systemd/user/database-ssh-tunnel@.service

10 lines
448 B
Desktop File

[Unit]
Description=SSH Persistent port forward for %i, makes available remote port locally
After=network-online.target
Wants=network-online.target
[Service]
EnvironmentFile=%h/.ssh/tunnels.d/%i.conf
ExecStart=/usr/bin/ssh -NT -o ExitOnForwardFailure=yes -o ServerAliveInterval=60 -o ServerAliveCountMax=3 -L ${TUNNEL_LOCAL_ADDRESS}:${TUNNEL_LOCAL_PORT}:${TUNNEL_REMOTE_ADDRESS}:${TUNNEL_REMOTE_PORT} ${TUNNEL_SSH_HOST}
RestartSec=3
Restart=always