X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Fssh%2Ftemplates%2Fsshd_config.erb;h=870f16fa68f99c58c2a7b19a7f0026ebb23fd3fe;hb=a02c0d91f3ddf38694d750e8e8320bc2987e8365;hp=ca68f52306ce887ebf9cedc6dac1402ada620127;hpb=107096692773af58fb62658abe5208bd76cb8682;p=mirror%2Fdsa-puppet.git diff --git a/modules/ssh/templates/sshd_config.erb b/modules/ssh/templates/sshd_config.erb index ca68f5230..870f16fa6 100644 --- a/modules/ssh/templates/sshd_config.erb +++ b/modules/ssh/templates/sshd_config.erb @@ -28,6 +28,8 @@ HostKey /etc/ssh/ssh_host_ed25519_key MaxStartups 100:30:200 <% end %> +LogLevel VERBOSE + # Authentication: PermitRootLogin without-password @@ -43,10 +45,32 @@ Subsystem sftp /usr/lib/openssh/sftp-server UsePAM yes -AuthorizedKeysFile /etc/ssh/userkeys/%u /var/lib/misc/userkeys/%u /etc/ssh/userkeys/%u.more +AuthorizedKeysFile /etc/ssh/userkeys/%u /var/lib/misc/userkeys/%u /etc/ssh/userkeys/%u.more /etc/ssh/puppetkeys/%u PasswordAuthentication no +<%= + allnodeinfo = scope.lookupvar('deprecated::allnodeinfo') + out = '' + settings = '# Banner "You are coming from a debian.org host."' + allnodeinfo.keys.sort.each do |node| + next unless allnodeinfo[node].has_key?('ipHostNumber') + out += "# Match Address " + out += allnodeinfo[node]['ipHostNumber'].collect do |ipnum| + if ipnum =~ /:/ + "#{ipnum}/128" + else + "#{ipnum}/32" + end + end.join(',') + out += " # #{node}" + out += "\n" + out += settings + out += "\n\n" + end + out +%> + Match Group sftponly AllowStreamLocalForwarding no AllowTCPForwarding no