add ssh-tunnel service and functions
This commit is contained in:
parent
6944ab1e25
commit
b3df5795f2
4 changed files with 47 additions and 13 deletions
10
configs/systemd/user/database-ssh-tunnel@.service
Normal file
10
configs/systemd/user/database-ssh-tunnel@.service
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
[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
|
||||
Loading…
Add table
Add a link
Reference in a new issue