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

Commit

Permalink
Parameterise Banner and DebianBanner as defaults
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tsenart committed Oct 17, 2016
1 parent 5e16bc3 commit c315a65
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
6 changes: 6 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ ssh_print_motd: false # sshd
# false to disable display of last login information
ssh_print_last_log: false # sshd

# false to disable serving /etc/ssh/banner.txt before authentication is allowed
ssh_banner: false # sshd

# false to disable distribution version leakage during initial protocol handshake
ssh_print_debian_banner: false # sshd (Debian OS family only)

# true to enable sftp configuration
sftp_enabled: false

Expand Down
9 changes: 5 additions & 4 deletions templates/opensshd.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,11 @@ PrintMotd {{ 'yes' if ssh_print_motd else 'no' }}

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

#Banner /etc/ssh/banner.txt
#UseDNS yes
#PidFile /var/run/sshd.pid
#MaxStartups 10
Banner {{ '/etc/ssh/banner.txt' if ssh_banner else 'none' }}

{% if ansible_os_family == 'Debian' %}
DebianBanner {{ 'yes' if ssh_print_debian_banner else 'no' }}
{% endif %}

{% if sftp_enabled %}
# Configuration, in case SFTP is used
Expand Down

0 comments on commit c315a65

Please sign in to comment.