Page MenuHomeDevCentral

D3012.id7690.diff
No OneTemporary

D3012.id7690.diff

diff --git a/roles/core/sshd/files/sshd_config b/roles/core/sshd/files/sshd_config
--- a/roles/core/sshd/files/sshd_config
+++ b/roles/core/sshd/files/sshd_config
@@ -14,6 +14,11 @@
# and will be lost if the state is redeployed.
# </auto-generated>
+{% if should_listen_to_private_address -%}
+ListenAddress {{ listen_private_address }}
+ListenAddress localhost
+{%- endif %}
+
# The default is to check both .ssh/authorized_keys and .ssh/authorized_keys2
# but this is overridden so installations will only check .ssh/authorized_keys
AuthorizedKeysFile .ssh/authorized_keys
diff --git a/roles/core/sshd/init.sls b/roles/core/sshd/init.sls
--- a/roles/core/sshd/init.sls
+++ b/roles/core/sshd/init.sls
@@ -8,6 +8,8 @@
{% from "map.jinja" import paths, capabilities with context %}
+{% set network = salt["node.resolve_network"]() %}
+
# -------------------------------------------------------------
# OpenSSH
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -17,6 +19,8 @@
- source: salt://roles/core/sshd/files/sshd_config
- template: jinja
- context:
+ listen_private_address: {{ network["private_ipv4_address"] | default("localhost") }}
+ should_listen_to_private_address: {{ network["is_private_network_stable"] | default(false) }}
sftp: {{ paths.sftp }}
print_motd: {{ not capabilities['MOTD-printed-at-login'] }}

File Metadata

Mime Type
text/plain
Expires
Mon, Oct 7, 18:20 (21 h, 45 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2180681
Default Alt Text
D3012.id7690.diff (1 KB)

Event Timeline