Restore an empty line in sshd_config
[mirror/dsa-puppet.git] / modules / ssh / templates / sshd_config.erb
1 ##
2 ## THIS FILE IS UNDER PUPPET CONTROL. DON'T EDIT IT HERE.
3 ## USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git
4 ##
5
6 Port 22
7
8 <% @extraports.each do |port| -%>
9 ListenAddress <%= port %>
10 <% end -%>
11 # Use these options to restrict which interfaces/protocols sshd will bind to
12 Protocol 2
13
14 HostKey /etc/ssh/ssh_host_rsa_key
15 <%- if has_variable?("has_etc_ssh_ssh_host_ed25519_key") && @has_etc_ssh_ssh_host_ed25519_key -%>
16 HostKey /etc/ssh/ssh_host_ed25519_key
17 <% end %>
18 <% if classes.include?("roles::ssh_upload") -%>
19 # On ssh upload hosts we have many clients doing ssh connections to us.
20 # sshd has - by default - a limit of 10 on the number of currently
21 # unauthenticated (or not yet authenticated) connections.  Raise that limit.
22 MaxStartups 100:30:200
23 <% end %>
24
25 LogLevel VERBOSE
26
27 # Authentication:
28 PermitRootLogin without-password
29
30 ChallengeResponseAuthentication no
31
32 PrintMotd no
33
34 #MaxStartups 10:30:60
35
36 AcceptEnv LANG LC_*
37
38 Subsystem sftp /usr/lib/openssh/sftp-server
39
40 UsePAM yes
41
42 AuthorizedKeysFile /etc/ssh/userkeys/%u /var/lib/misc/userkeys/%u /etc/ssh/userkeys/%u.more /etc/ssh/puppetkeys/%u
43
44 PasswordAuthentication no
45
46 <%=
47   allnodeinfo = scope.lookupvar('deprecated::allnodeinfo')
48   out = ''
49   settings = '#  Banner "You are coming from a debian.org host."'
50   allnodeinfo.keys.sort.each do |node|
51       next unless allnodeinfo[node].has_key?('ipHostNumber')
52       out += "# Match Address "
53       out += allnodeinfo[node]['ipHostNumber'].collect do |ipnum|
54           if ipnum =~ /:/
55               "#{ipnum}/128"
56           else
57               "#{ipnum}/32"
58           end
59       end.join(',')
60       out += " # #{node}"
61       out += "\n"
62       out += settings
63       out += "\n\n"
64   end
65   out
66 %>
67
68 Match Group sftponly
69   AllowStreamLocalForwarding no
70   AllowTCPForwarding no
71   X11Forwarding no
72   ForceCommand internal-sftp