ssh_tunnel/templates/local/ssh_config.j2
2023-01-09 13:34:43 +01:00

15 lines
No EOL
665 B
Django/Jinja

Host gateway
HostName tunnel-end.a-0.me
User ssh-tunnel
Port 22
IdentityFile /home/autossh/.ssh/tunnel-key
IdentitiesOnly yes
ExitOnForwardFailure yes
ServerAliveInterval 5
ServerAliveCountMax 3
{% for forwarding in remote_forward %}
RemoteForward localhost:{{ forwarding.ephemeral_port }} {{ forwarding.dest_host }}:{{ forwarding.dest_port }}
{% endfor %}
{% for forwarding in local_forward %}
LocalForward {{ query('community.general.dig', inventory_hostname, 'qtype=A') | first }}:{{ forwarding.local_port }} {{ forwarding.remote_bind_ip }}:{{ forwarding.remote_port }}
{% endfor %}