@@ -49,13 +49,13 @@ LogLevel VERBOSE
4949# -- see: (http://net-ssh.github.com/net-ssh/classes/Net/SSH/Transport/CipherFactory.html)
5050#
5151{% 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' ) -%}
5353 Ciphers {{ ssh_ciphers_66_weak | join(',') }}
5454 {% else %}
5555 Ciphers {{ ssh_ciphers_53_weak | join(',') }}
5656 {% endif %}
5757{% 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' ) -%}
5959 Ciphers {{ ssh_ciphers_66_default | join(',') }}
6060 {% else -%}
6161 Ciphers {{ ssh_ciphers_53_default | join(',') }}
@@ -68,13 +68,13 @@ LogLevel VERBOSE
6868#
6969
7070{% 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' ) -%}
7272 MACs {{ ssh_macs_66_weak | join(',') }}
7373 {% elif ansible_os_family in ['Oracle Linux' , 'RedHat' ] and ansible_distribution_major_version <= '6' -%}
7474 MACs {{ ssh_macs_53_default | join(',') }}
7575 {% endif %}
7676{% 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' ) -%}
7878 MACs {{ ssh_macs_66_default | join(',') }}
7979 {% elif ansible_os_family in ['Oracle Linux' , 'RedHat' ] and ansible_distribution_major_version <= '6' -%}
8080 MACs {{ ssh_macs_53_default | join(',') }}
@@ -90,7 +90,7 @@ LogLevel VERBOSE
9090# Weak kex is sometimes required if older package versions are used
9191# 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.
9292# 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' ) -%}
9494 {% if ssh_server_weak_kex -%}
9595 KexAlgorithms {{ ssh_kex_66_weak | join(',') }}
9696 {% else -%}
@@ -196,7 +196,9 @@ X11UseLocalhost yes
196196
197197PrintMotd {{ 'yes' if ssh_print_motd else 'no' }}
198198
199+ {% if ansible_os_family != 'FreeBSD' %}
199200PrintLastLog {{ 'yes' if ssh_print_last_log else 'no' }}
201+ {% endif %}
200202
201203Banner {{ '/etc/ssh/banner.txt' if ssh_banner else 'none' }}
202204
0 commit comments