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

Commit c315a65

Browse files
committed
Parameterise Banner and DebianBanner as defaults
This commit parameterises `Banner` and `DebianBanner` in the sshd config with the defaults `ssh_banner` and `ssh_print_debian_banner` respectively, though the latter is only supported on Debian family distributions. Debian based distributions will have `DebianBanner no` set by default from now on.
1 parent 5e16bc3 commit c315a65

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

defaults/main.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,12 @@ ssh_print_motd: false # sshd
6969
# false to disable display of last login information
7070
ssh_print_last_log: false # sshd
7171

72+
# false to disable serving /etc/ssh/banner.txt before authentication is allowed
73+
ssh_banner: false # sshd
74+
75+
# false to disable distribution version leakage during initial protocol handshake
76+
ssh_print_debian_banner: false # sshd (Debian OS family only)
77+
7278
# true to enable sftp configuration
7379
sftp_enabled: false
7480

templates/opensshd.conf.j2

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,10 +198,11 @@ PrintMotd {{ 'yes' if ssh_print_motd else 'no' }}
198198

199199
PrintLastLog {{ 'yes' if ssh_print_last_log else 'no' }}
200200

201-
#Banner /etc/ssh/banner.txt
202-
#UseDNS yes
203-
#PidFile /var/run/sshd.pid
204-
#MaxStartups 10
201+
Banner {{ '/etc/ssh/banner.txt' if ssh_banner else 'none' }}
202+
203+
{% if ansible_os_family == 'Debian' %}
204+
DebianBanner {{ 'yes' if ssh_print_debian_banner else 'no' }}
205+
{% endif %}
205206

206207
{% if sftp_enabled %}
207208
# Configuration, in case SFTP is used

0 commit comments

Comments
 (0)