@@ -49,13 +49,13 @@ LogLevel VERBOSE
49
49
# -- see: (http://net-ssh.github.com/net-ssh/classes/Net/SSH/Transport/CipherFactory.html)
50
50
#
51
51
{% if ssh_server_cbc_required -%}
52
- {% if (ansible_distribution == 'Ubuntu' and ansible_distribution_version >= '14.04' ) or (ansible_distribution == 'Debian' and ansible_distribution_version >= '8' ) or (ansible_os_family in ['Oracle Linux' , 'RedHat' ] and ansible_distribution_major_version >= '7' ) -%}
52
+ {% if (ansible_distribution == 'Ubuntu' and ansible_distribution_version >= '14.04' ) or (ansible_distribution == 'Debian' and ansible_distribution_version >= '8' ) or (ansible_os_family in ['Oracle Linux' , 'RedHat' ] and ansible_distribution_major_version >= '7' ) or ( ansible_distribution == 'FreeBSD' and ansible_distribution_version >= '11' ) -%}
53
53
Ciphers {{ ssh_ciphers_66_weak | join(',') }}
54
54
{% else %}
55
55
Ciphers {{ ssh_ciphers_53_weak | join(',') }}
56
56
{% endif %}
57
57
{% else -%}
58
- {% if (ansible_distribution == 'Ubuntu' and ansible_distribution_version >= '14.04' ) or (ansible_distribution == 'Debian' and ansible_distribution_version >= '8' ) or (ansible_os_family in ['Oracle Linux' , 'RedHat' ] and ansible_distribution_major_version >= '7' ) -%}
58
+ {% if (ansible_distribution == 'Ubuntu' and ansible_distribution_version >= '14.04' ) or (ansible_distribution == 'Debian' and ansible_distribution_version >= '8' ) or (ansible_os_family in ['Oracle Linux' , 'RedHat' ] and ansible_distribution_major_version >= '7' ) or ( ansible_distribution == 'FreeBSD' and ansible_distribution_version >= '11' ) -%}
59
59
Ciphers {{ ssh_ciphers_66_default | join(',') }}
60
60
{% else -%}
61
61
Ciphers {{ ssh_ciphers_53_default | join(',') }}
@@ -68,13 +68,13 @@ LogLevel VERBOSE
68
68
#
69
69
70
70
{% if ssh_server_weak_hmac -%}
71
- {% if (ansible_distribution == 'Ubuntu' and ansible_distribution_version >= '14.04' ) or (ansible_distribution == 'Debian' and ansible_distribution_version >= '8' ) or (ansible_os_family in ['Oracle Linux' , 'RedHat' ] and ansible_distribution_major_version >= '7' ) -%}
71
+ {% if (ansible_distribution == 'Ubuntu' and ansible_distribution_version >= '14.04' ) or (ansible_distribution == 'Debian' and ansible_distribution_version >= '8' ) or (ansible_os_family in ['Oracle Linux' , 'RedHat' ] and ansible_distribution_major_version >= '7' ) or ( ansible_distribution == 'FreeBSD' and ansible_distribution_version >= '11' ) -%}
72
72
MACs {{ ssh_macs_66_weak | join(',') }}
73
73
{% elif ansible_os_family in ['Oracle Linux' , 'RedHat' ] and ansible_distribution_major_version <= '6' -%}
74
74
MACs {{ ssh_macs_53_default | join(',') }}
75
75
{% endif %}
76
76
{% else -%}
77
- {% if (ansible_distribution == 'Ubuntu' and ansible_distribution_version >= '14.04' ) or (ansible_distribution == 'Debian' and ansible_distribution_version >= '8' ) or (ansible_os_family in ['Oracle Linux' , 'RedHat' ] and ansible_distribution_major_version >= '7' ) -%}
77
+ {% if (ansible_distribution == 'Ubuntu' and ansible_distribution_version >= '14.04' ) or (ansible_distribution == 'Debian' and ansible_distribution_version >= '8' ) or (ansible_os_family in ['Oracle Linux' , 'RedHat' ] and ansible_distribution_major_version >= '7' ) or ( ansible_distribution == 'FreeBSD' and ansible_distribution_version >= '11' ) -%}
78
78
MACs {{ ssh_macs_66_default | join(',') }}
79
79
{% elif ansible_os_family in ['Oracle Linux' , 'RedHat' ] and ansible_distribution_major_version <= '6' -%}
80
80
MACs {{ ssh_macs_53_default | join(',') }}
@@ -90,7 +90,7 @@ LogLevel VERBOSE
90
90
# Weak kex is sometimes required if older package versions are used
91
91
# 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.
92
92
# based on: https://bettercrypto.org/static/applied-crypto-hardening.pdf
93
- {% if (ansible_distribution == 'Ubuntu' and ansible_distribution_version >= '14.04' ) or (ansible_distribution == 'Debian' and ansible_distribution_version >= '8' ) or (ansible_os_family in ['Oracle Linux' , 'RedHat' ] and ansible_distribution_major_version >= '7' ) -%}
93
+ {% if (ansible_distribution == 'Ubuntu' and ansible_distribution_version >= '14.04' ) or (ansible_distribution == 'Debian' and ansible_distribution_version >= '8' ) or (ansible_os_family in ['Oracle Linux' , 'RedHat' ] and ansible_distribution_major_version >= '7' ) or ( ansible_distribution == 'FreeBSD' and ansible_distribution_version >= '11' ) -%}
94
94
{% if ssh_server_weak_kex -%}
95
95
KexAlgorithms {{ ssh_kex_66_weak | join(',') }}
96
96
{% else -%}
@@ -196,7 +196,9 @@ X11UseLocalhost yes
196
196
197
197
PrintMotd {{ 'yes' if ssh_print_motd else 'no' }}
198
198
199
+ {% if ansible_os_family != 'FreeBSD' %}
199
200
PrintLastLog {{ 'yes' if ssh_print_last_log else 'no' }}
201
+ {% endif %}
200
202
201
203
Banner {{ '/etc/ssh/banner.txt' if ssh_banner else 'none' }}
202
204
0 commit comments