1
0
Fork 0
forked from infra/ansible

basessh: Use ListenAddress on hosts with secondary addresses.

If a host has a secondary ipv4 or ipv6 address, only have sshd listen on
the primary ip. This will allow hosts with secondary ips to use ssh port
on secondary ip's for other things.

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
This commit is contained in:
Kevin Fenzi 2026-06-23 14:42:56 -07:00
commit 6a624f306b

View file

@ -1,6 +1,12 @@
Protocol 2
Port {{ sshd_port }}
{% if eth0_secondary_ipv4_ip is defined %}
ListenAddress {{ eth0_ipv4_ip }}
{% endif %}
{% if eth0_secondary_ipv6_ip is defined %}
ListenAddress {{ eth0_ipv6_ip }}
{% endif %}
# This system is following system-wide crypto policy. The changes to
# crypto properties (Ciphers, MACs, ...) will not have any effect in