module-sshd/templates/sshd_config/Ubuntu_lucid.erb

127 lines
4.1 KiB
Text
Raw Normal View History

2010-05-19 01:30:50 +02:00
# Package generated configuration file
# See the sshd(8) manpage for details
2012-06-05 23:23:03 +02:00
<% unless (s=scope.lookupvar('sshd::head_additional_options')).empty? -%>
<%= s %>
<% end -%>
2010-05-19 01:30:50 +02:00
# What ports, IPs and protocols we listen for
2012-06-05 23:23:03 +02:00
<% scope.lookupvar('sshd::ports').to_a.each do |port| -%>
<% if port == 'off' -%>
2010-05-19 01:30:50 +02:00
#Port -- disabled by puppet
<% else -%>
Port <%= port %>
2010-05-19 01:30:50 +02:00
<% end -%>
2012-06-05 23:23:03 +02:00
<% end -%>
2010-05-19 01:30:50 +02:00
# Use these options to restrict which interfaces/protocols sshd will bind to
2012-06-05 23:23:03 +02:00
<% scope.lookupvar('sshd::listen_address').to_a.each do |address| -%>
2010-05-19 01:30:50 +02:00
ListenAddress <%= address %>
<% end -%>
Protocol 2
# HostKeys for protocol version 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
#Privilege Separation is turned on for security
UsePrivilegeSeparation yes
# ...but breaks Pam auth via kbdint, so we have to turn it off
# Use PAM authentication via keyboard-interactive so PAM modules can
# properly interface with the user (off due to PrivSep)
#PAMAuthenticationViaKbdInt no
# Lifetime and size of ephemeral version 1 server key
KeyRegenerationInterval 3600
ServerKeyBits 768
# Logging
SyslogFacility AUTH
LogLevel INFO
# Authentication:
LoginGraceTime 600
2012-06-05 23:23:03 +02:00
PermitRootLogin <%= scope.lookupvar('sshd::permit_root_login') %>
2010-05-19 01:30:50 +02:00
2012-06-05 23:23:03 +02:00
StrictModes <%= scope.lookupvar('sshd::strict_modes') %>
2010-05-19 01:30:50 +02:00
2012-06-05 23:23:03 +02:00
RSAAuthentication <%= scope.lookupvar('sshd::rsa_authentication') %>
2010-05-19 01:30:50 +02:00
2012-06-05 23:23:03 +02:00
PubkeyAuthentication <%= scope.lookupvar('sshd::pubkey_authentication') %>
2010-05-19 01:30:50 +02:00
2012-06-05 23:23:03 +02:00
AuthorizedKeysFile <%= scope.lookupvar('sshd::authorized_keys_file') %>
2010-05-19 01:30:50 +02:00
# For this to work you will also need host keys in /etc/ssh_known_hosts
2012-06-05 23:23:03 +02:00
RhostsRSAAuthentication <%= scope.lookupvar('sshd::rhosts_rsa_authentication') %>
2010-05-19 01:30:50 +02:00
# Don't read the user's ~/.rhosts and ~/.shosts files
2012-06-05 23:23:03 +02:00
IgnoreRhosts <%= scope.lookupvar('sshd::ignore_rhosts') %>
2010-05-19 01:30:50 +02:00
# similar for protocol version 2
2012-06-05 23:23:03 +02:00
HostbasedAuthentication <%= scope.lookupvar('sshd::hostbased_authentication') %>
2010-05-19 01:30:50 +02:00
# Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
#IgnoreUserKnownHosts yes
# To enable empty passwords, change to yes (NOT RECOMMENDED)
2012-06-05 23:23:03 +02:00
PermitEmptyPasswords <%= scope.lookupvar('sshd::permit_empty_passwords') %>
2010-05-19 01:30:50 +02:00
# Change to no to disable s/key passwords
2012-06-05 23:23:03 +02:00
ChallengeResponseAuthentication <%= scope.lookupvar('sshd::challenge_response_authentication') %>
2010-05-19 01:30:50 +02:00
# To disable tunneled clear text passwords, change to no here!
2012-06-05 23:23:03 +02:00
PasswordAuthentication <%= scope.lookupvar('sshd::password_authentication') %>
2010-05-19 01:30:50 +02:00
# To change Kerberos options
#KerberosAuthentication no
#KerberosOrLocalPasswd yes
#AFSTokenPassing no
#KerberosTicketCleanup no
# Kerberos TGT Passing does only work with the AFS kaserver
#KerberosTgtPassing yes
2012-06-05 23:23:03 +02:00
X11Forwarding <%= scope.lookupvar('sshd::x11_forwarding') %>
2010-05-19 01:30:50 +02:00
X11DisplayOffset 10
KeepAlive yes
#UseLogin no
#MaxStartups 10:30:60
#Banner /etc/issue.net
#ReverseMappingCheck yes
2012-06-05 23:23:03 +02:00
Subsystem sftp <%= (s=scope.lookupvar('sshd::sftp_subsystem')).empty? ? '/usr/lib/openssh/sftp-server' : s %>
2010-05-19 01:30:50 +02:00
# Set this to 'yes' to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the ChallengeResponseAuthentication and
# PasswordAuthentication. Depending on your PAM configuration,
# PAM authentication via ChallengeResponseAuthentication may bypass
# the setting of "PermitRootLogin without-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to 'no'.
2012-06-05 23:23:03 +02:00
UsePAM <%= scope.lookupvar('sshd::use_pam') %>
2010-05-19 01:30:50 +02:00
HostbasedUsesNameFromPacketOnly yes
2012-06-05 23:23:03 +02:00
AllowTcpForwarding <%= scope.lookupvar('sshd::tcp_forwarding') %>
2010-05-19 01:30:50 +02:00
2012-06-05 23:23:03 +02:00
AllowAgentForwarding <%= scope.lookupvar('sshd::agent_forwarding') %>
2010-05-19 01:30:50 +02:00
2012-06-05 23:23:03 +02:00
<% unless (s=scope.lookupvar('sshd::allowed_users')).empty? -%>
AllowUsers <%= s %>
<% end -%>
<% unless (s=scope.lookupvar('sshd::allowed_groups')).empty? -%>
AllowGroups <%= s %>
2010-05-19 01:30:50 +02:00
<%- end -%>
2012-06-05 23:23:03 +02:00
PrintMotd <%= scope.lookupvar('sshd::print_motd') %>
2010-05-19 01:30:50 +02:00
2012-06-05 23:23:03 +02:00
<% if scope.lookupvar('sshd::hardened_ssl') == 'yes' -%>
Ciphers aes256-ctr
MACs hmac-sha1
2012-06-05 23:23:03 +02:00
<% end -%>
<% unless (s=scope.lookupvar('sshd::tail_additional_options')).empty? -%>
<%= s %>
<% end -%>