Skip to content

Commit

Permalink
Included attribute either to include path to SSH Banner file or to di…
Browse files Browse the repository at this point in the history
…sable it
  • Loading branch information
sidxz committed Nov 8, 2016
1 parent 4e1e757 commit ab65799
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
12 changes: 2 additions & 10 deletions attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,8 @@
default['ssh']['allow_groups'] = [] # sshd
default['ssh']['print_motd'] = false # sshd
default['ssh']['print_last_log'] = false # sshd

# Banner
default['ssh']['banner'] = false # sshd
case node['platform']
when 'suse', 'opensuse', 'opensuseleap'
default['ssh']['banner_path'] = '/etc/issue' # sshd
else
default['ssh']['banner_path'] = '/etc/issue.net' # sshd
end

# set this to nil to disable banner or provide a path like '/etc/issue.net'
default['ssh']['banner'] = nil # 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
Expand Down
2 changes: 1 addition & 1 deletion templates/default/opensshd.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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'] ? @node['ssh']['banner_path'] : 'none' %>
Banner <%= @node['ssh']['banner'] ? @node['ssh']['banner'] : 'none' %>
<% if @node['platform_family'] == 'debian' %>
DebianBanner <%= @node['ssh']['os_banner'] ? 'yes' : 'no' %>
Expand Down

0 comments on commit ab65799

Please sign in to comment.