Skip to content
This repository was archived by the owner on Dec 26, 2020. It is now read-only.

Commit 0b85e97

Browse files
committed
Fixed KexAlgorithms Conditional Statement
Corrected the conditional statement which was missing an `elif`. (also now with same formating as openssh client template), sshd_kex_59_weak was omitted and is now re-added and `client` selector needed to be changed to `server` for sshd template.
1 parent e7ac668 commit 0b85e97

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

templates/opensshd.conf.j2

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,16 @@ LogLevel VERBOSE
9999
# eg ruby's Net::SSH at around 2.2.* doesn't support sha2 for kex, so this will have to be set true in this case.
100100
# based on: https://bettercrypto.org/static/applied-crypto-hardening.pdf
101101
{% if ansible_distribution == 'Ubuntu' and ansible_distribution_version >= '14.04' -%}
102-
{% if ssh_client_weak_kex -%}
102+
{% if sshd_server_weak_kex -%}
103103
KexAlgorithms {{ ssh_kex_66_weak | join(',') }}
104104
{% else -%}
105105
KexAlgorithms {{ ssh_kex_66_default | join(',') }}
106106
{% endif %}
107107
{% else -%}
108108
{% if ansible_os_family in ['Oracle Linux', 'RedHat'] or (ansible_distribution == 'Debian' and ansible_distribution_major_version <= '6') -%}
109109
#KexAlgorithms
110+
{% elif sshd_server_weak_kex -%}
111+
KexAlgorithms {{ sshd_kex_59_weak | join(',') }}
110112
{% else -%}
111113
KexAlgorithms {{ ssh_kex_59_default | join(',') }}
112114
{% endif %}

0 commit comments

Comments
 (0)