Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# sshd server configuration file, allowing root. -*- conf -*-
#
# This sshd configuration permits root logins provided that they're done via
# GSS-API. It will eventually become the default. The default configuration
# values that we don't change are omitted from this file.
Port 22
Protocol 2
<% if operatingsystem == 'RedHat' then -%>
UsePrivilegeSeparation yes
<% end -%>
# Only support RSA keys, not DSA keys.
HostKey /etc/ssh/ssh_host_rsa_key
# Increase the login grace period from 120 seconds to 300 seconds (5 minutes).
LoginGraceTime 300
# Prevent attackers from running long password guessing attacks.
MaxAuthTries <%= max_tries %>
# Disable all forms of host-based and public key authentication by default,
# since we use GSS-API (or passwords).
IgnoreRhosts yes
RSAAuthentication no
PubkeyAuthentication <%= pubkey ? 'yes' : 'no' %>
RhostsRSAAuthentication no
HostbasedAuthentication <%= hostbased ? 'yes' : 'no' %>
# Allow password authentication via PAM, but not empty passwords.
ChallengeResponseAuthentication yes
PasswordAuthentication yes
UsePAM yes
PermitEmptyPasswords no
# Enable GSS-API authentication. Eventually (squeeze and later) we will want
# to add GSSAPIStoreCredentialsOnRekey yes.
GSSAPIAuthentication yes
GSSAPICleanupCredentials yes
<% if (operatingsystem != 'RedHat') or (lsbmajdistrelease.to_i() >= 6) then -%>
GSSAPIKeyExchange yes
GSSAPIStrictAcceptorCheck no
<% end -%>
<% if (operatingsystem == 'Debian') and (lsbdistcodename != 'lenny') then -%>
GSSAPIStoreCredentialsOnRekey yes
<% end -%>
<% if (operatingsystem == 'RedHat') and (lsbmajdistrelease.to_i() >= 6) then -%>
GSSAPIStoreCredentialsOnRekey yes
<% end -%>
<% if (operatingsystem == 'Ubuntu') then -%>
GSSAPIStoreCredentialsOnRekey yes
<% end -%>
# Allow root login, but only if no password was used (meaning GSS-API).
PermitRootLogin without-password
# Allow X forwarding.
X11Forwarding yes
X11DisplayOffset 10
<% if operatingsystem != 'RedHat' then -%>
# Disable printing of the MOTD, since this is done via other means on Debian.
PrintMotd no
<% end -%>
# Send TCP keep-alive messages to keep the connection open through firewalls
# and notice connection termination.
TCPKeepAlive yes
# Enable sftp.
<% if operatingsystem == 'RedHat' then -%>
Subsystem sftp /usr/libexec/openssh/sftp-server
<% else -%>
Subsystem sftp /usr/lib/openssh/sftp-server
<% end -%>
<% if gitolite then -%>
# gitolite user should run through a wrapper to map it to actual user.
Match User gitolite
ForceCommand /usr/share/gitolite/gitolite-wrapper
<% end -%>
<%
if (listen_addresses != 'all')
# Split the addresses at the commas.
addresses = listen_addresses.split(',')
addresses.each |address| do
-%>
ListenAddress <%= address %>
<%
end
end
-%>