From 325fb9c59f583e59bf07f2e9ca87640cfc885810 Mon Sep 17 00:00:00 2001 From: Siddhant Rath Date: Mon, 7 Nov 2016 14:43:37 -0600 Subject: [PATCH] Configurable SSH Banner File --- attributes/default.rb | 1 + templates/default/opensshd.conf.erb | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/attributes/default.rb b/attributes/default.rb index 0fca56a..f4ca17f 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -72,6 +72,7 @@ default['ssh']['print_motd'] = false # sshd default['ssh']['print_last_log'] = false # sshd default['ssh']['banner'] = false # sshd +default['ssh']['banner_path'] = '/etc/ssh/banner.txt' # sshd default['ssh']['os_banner'] = false # sshd (Debian OS family) # set this to nil to let us use the default OpenSSH in case it's not set by the user diff --git a/templates/default/opensshd.conf.erb b/templates/default/opensshd.conf.erb index c87eeba..7353c42 100644 --- a/templates/default/opensshd.conf.erb +++ b/templates/default/opensshd.conf.erb @@ -177,7 +177,7 @@ X11UseLocalhost yes PrintMotd <%= ((@node['ssh']['print_motd']) ? 'yes' : 'no' ) %> PrintLastLog <%= ((@node['ssh']['print_last_log']) ? 'yes' : 'no' ) %> -Banner <%= @node['ssh']['banner'] ? '/etc/ssh/banner.txt' : 'none' %> +Banner <%= @node['ssh']['banner'] ? @node['ssh']['banner_path'] : 'none' %> <% if @node['platform_family'] == 'debian' %> DebianBanner <%= @node['ssh']['os_banner'] ? 'yes' : 'no' %>