ssh-tunnel-client
Create persistent ssh tunnels via autossh (Centos7)
ssh_tunnel_client_user
- default is ssh_tunnel
ssh_tunnels
- array with keys:
name
- name used for naming serviceskey_file
- priv ssh keytarget_host
- requiredtarget_port
- requiredlocal_port
- requiredremote_user
- set tossh_tunnel
by defaultalive_interval
- set to10
by defaultalive_count_max
- set to1
by default
Warning
Autossh binds to a monitoring port on the remote machine. A fixed port is used and multiple clients cannot not bind to the same port at the same time what causes the ssh session to be restarted every 10 minutes.
The port randomization does not work in latest centos 7 version (1.4e) as of this writing.
That's why the autossh monitoring is turned off.
Even without the monitoring it should work fine, because ssh exits quickly when there is no
connection thanks to -oServerAliveInterval=60 -oServerAliveCountMax=2
options.
For more info see: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=351162
Sidenote: Upon consideration, why do I need autossh then? Won't systemd take care of the restarting?
ansible-galaxy install pinkeen/ansible-role-ssh-tunnel-client