Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configurable SSH Banner File #130

Merged
merged 1 commit into from
Nov 8, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ This cookbook provides secure ssh-client and ssh-server configurations.
* `['ssh']['use_pam']` - `false` to disable pam authentication
* `['ssh']['print_motd']` - `false` to disable printing of the MOTD
* `['ssh']['print_last_log']` - `false` to disable display of last login information
* `['ssh']['banner']` - `nil` to disable banner or provide a path like '/etc/issue.net'
* `['ssh']['max_auth_tries']` - controls `MaxAuthTries`; the number of authentication attempts per connection.
* `['ssh']['max_sessions']` - controls `MaxSessions`; the number of sessions per connection.
* `['ssh']['deny_users']` - `[]` to configure `DenyUsers`, if specified login is disallowed for user names that match one of the patterns.
Expand Down
3 changes: 2 additions & 1 deletion attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@
default['ssh']['allow_groups'] = [] # sshd
default['ssh']['print_motd'] = false # sshd
default['ssh']['print_last_log'] = false # sshd
default['ssh']['banner'] = false # sshd
# 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'] ? '/etc/ssh/banner.txt' : 'none' %>
Banner <%= @node['ssh']['banner'] ? @node['ssh']['banner'] : 'none' %>

<% if @node['platform_family'] == 'debian' %>
DebianBanner <%= @node['ssh']['os_banner'] ? 'yes' : 'no' %>
Expand Down