Skip to content

Commit 73e8996

Browse files
Authorized keys custom path
1 parent d4dc236 commit 73e8996

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

attributes/default.rb

+1
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@
9999
default['ssh-hardening']['ssh']['server']['password_authentication'] = false
100100
default['ssh-hardening']['ssh']['server']['log_level'] = 'verbose'
101101
default['ssh-hardening']['ssh']['server']['accept_env'] = ['LANG', 'LC_*', 'LANGUAGE']
102+
default['ssh-hardening']['ssh']['server']['authorized_keys_path'] = nil # if not nil, full path to an authorized keys folder is expected
102103

103104
# sshd sftp options
104105
default['ssh-hardening']['ssh']['server']['sftp']['enable'] = false

templates/default/opensshd.conf.erb

+5
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,11 @@ MaxStartups 10:30:100
9696
# Enable public key authentication
9797
PubkeyAuthentication yes
9898

99+
<% if @node['ssh-hardening']['ssh']['server']['authorized_keys_path'] != nil %>
100+
# Customized authorized keys path
101+
AuthorizedKeysFile <%= @node['ssh-hardening']['ssh']['server']['authorized_keys_path'] %>
102+
<% end %>
103+
99104
# Never use host-based authentication. It can be exploited.
100105
IgnoreRhosts yes
101106
IgnoreUserKnownHosts yes

0 commit comments

Comments
 (0)