2011-01-19 23:13:39 +01:00
|
|
|
# $OpenBSD: sshd_config,v 1.81 2009/10/08 14:03:41 markus Exp $
|
|
|
|
# $FreeBSD: src/crypto/openssh/sshd_config,v 1.49.2.2.2.1 2010/06/14 02:09:06 kensmith Exp $
|
|
|
|
|
|
|
|
# This is the sshd server system-wide configuration file. See
|
|
|
|
# sshd_config(5) for more information.
|
|
|
|
|
|
|
|
# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin
|
|
|
|
|
|
|
|
# The strategy used for options in the default sshd_config shipped with
|
|
|
|
# OpenSSH is to specify options with their default value where
|
|
|
|
# possible, but leave them commented. Uncommented options change a
|
|
|
|
# default value.
|
|
|
|
|
|
|
|
# Note that some of FreeBSD's defaults differ from OpenBSD's, and
|
|
|
|
# FreeBSD has a few additional options.
|
|
|
|
|
|
|
|
#VersionAddendum FreeBSD-20100308
|
|
|
|
|
2012-06-05 23:23:03 +02:00
|
|
|
<% unless (s=scope.lookupvar('sshd::head_additional_options')).empty? -%>
|
|
|
|
<%= s %>
|
|
|
|
<% end -%>
|
2011-01-19 23:13:39 +01:00
|
|
|
|
2011-07-14 18:15:27 +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' -%>
|
2011-01-19 23:13:39 +01:00
|
|
|
#Port -- disabled by puppet
|
|
|
|
<% else -%>
|
2011-07-14 18:15:27 +02:00
|
|
|
Port <%= port %>
|
2011-01-19 23:13:39 +01:00
|
|
|
<% end -%>
|
2012-06-05 23:23:03 +02:00
|
|
|
<% end -%>
|
2011-01-19 23:13:39 +01:00
|
|
|
|
|
|
|
#AddressFamily any
|
2012-06-05 23:23:03 +02:00
|
|
|
<% scope.lookupvar('sshd::listen_address').to_a.each do |address| -%>
|
2011-01-19 23:13:39 +01:00
|
|
|
ListenAddress <%= address %>
|
|
|
|
<% end -%>
|
|
|
|
|
|
|
|
# The default requires explicit activation of protocol 1
|
|
|
|
Protocol 2
|
|
|
|
|
|
|
|
# HostKey for protocol version 1
|
|
|
|
#HostKey /etc/ssh/ssh_host_key
|
|
|
|
# HostKeys for protocol version 2
|
|
|
|
HostKey /etc/ssh/ssh_host_rsa_key
|
|
|
|
HostKey /etc/ssh/ssh_host_dsa_key
|
|
|
|
|
|
|
|
# Lifetime and size of ephemeral version 1 server key
|
|
|
|
#KeyRegenerationInterval 1h
|
|
|
|
#ServerKeyBits 1024
|
|
|
|
|
|
|
|
# Logging
|
|
|
|
# obsoletes QuietMode and FascistLogging
|
|
|
|
SyslogFacility AUTH
|
|
|
|
LogLevel INFO
|
|
|
|
|
|
|
|
# Authentication:
|
|
|
|
|
|
|
|
LoginGraceTime 600
|
2012-06-05 23:23:03 +02:00
|
|
|
PermitRootLogin <%= scope.lookupvar('sshd::permit_root_login') %>
|
2011-01-19 23:13:39 +01:00
|
|
|
|
2012-06-05 23:23:03 +02:00
|
|
|
StrictModes <%= scope.lookupvar('sshd::strict_modes') %>
|
2011-01-19 23:13:39 +01:00
|
|
|
|
|
|
|
#MaxAuthTries 6
|
|
|
|
#MaxSessions 10
|
|
|
|
|
2012-06-05 23:23:03 +02:00
|
|
|
RSAAuthentication <%= scope.lookupvar('sshd::rsa_authentication') %>
|
2011-01-19 23:13:39 +01:00
|
|
|
|
2012-06-05 23:23:03 +02:00
|
|
|
PubkeyAuthentication <%= scope.lookupvar('sshd::pubkey_authentication') %>
|
2011-01-19 23:13:39 +01:00
|
|
|
|
2012-06-05 23:23:03 +02:00
|
|
|
AuthorizedKeysFile <%= scope.lookupvar('sshd::authorized_keys_file') %>
|
2011-01-19 23:13:39 +01:00
|
|
|
|
|
|
|
# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
|
2012-06-05 23:23:03 +02:00
|
|
|
RhostsRSAAuthentication <%= scope.lookupvar('sshd::rhosts_rsa_authentication') %>
|
2011-01-19 23:13:39 +01:00
|
|
|
|
|
|
|
# similar for protocol version 2
|
2012-06-05 23:23:03 +02:00
|
|
|
HostbasedAuthentication <%= scope.lookupvar('sshd::hostbased_authentication') %>
|
2011-01-19 23:13:39 +01:00
|
|
|
|
|
|
|
# Change to yes if you don't trust ~/.ssh/known_hosts for
|
|
|
|
# RhostsRSAAuthentication and HostbasedAuthentication
|
|
|
|
#IgnoreUserKnownHosts no
|
|
|
|
# Don't read the user's ~/.rhosts and ~/.shosts files
|
|
|
|
#IgnoreRhosts yes
|
|
|
|
|
|
|
|
# Change to yes to enable built-in password authentication.
|
2012-06-05 23:23:03 +02:00
|
|
|
PasswordAuthentication <%= scope.lookupvar('sshd::password_authentication') %>
|
2011-01-19 23:13:39 +01:00
|
|
|
|
2012-06-05 23:23:03 +02:00
|
|
|
PermitEmptyPasswords <%= scope.lookupvar('sshd::permit_empty_passwords') %>
|
2011-01-19 23:13:39 +01:00
|
|
|
|
|
|
|
# Change to no to disable PAM authentication
|
2012-06-05 23:23:03 +02:00
|
|
|
ChallengeResponseAuthentication <%= scope.lookupvar('sshd::challenge_response_authentication') %>
|
2011-01-19 23:13:39 +01:00
|
|
|
|
|
|
|
# Kerberos options
|
2012-06-05 23:23:03 +02:00
|
|
|
KerberosAuthentication <%= scope.lookupvar('sshd::kerberos_authentication') %>
|
2012-06-18 22:43:42 +02:00
|
|
|
KerberosOrLocalPasswd <%= scope.lookupvar('sshd::kerberos_orlocalpasswd') %>
|
2012-06-05 23:23:03 +02:00
|
|
|
KerberosTicketCleanup <%= scope.lookupvar('sshd::kerberos_ticketcleanup') %>
|
2011-01-19 23:13:39 +01:00
|
|
|
|
|
|
|
# GSSAPI options
|
2012-06-05 23:23:03 +02:00
|
|
|
GSSAPIAuthentication <%= scope.lookupvar('sshd::gssapi_authentication') %>
|
|
|
|
GSSAPICleanupCredentials <%= scope.lookupvar('sshd::gssapi_cleanupcredentials') %>
|
2011-01-19 23:13:39 +01:00
|
|
|
|
|
|
|
# Set this to 'no' to disable 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') %>
|
2011-01-19 23:13:39 +01:00
|
|
|
|
2012-06-05 23:23:03 +02:00
|
|
|
AllowAgentForwarding <%= scope.lookupvar('sshd::agent_forwarding') %>
|
2011-01-19 23:13:39 +01:00
|
|
|
|
2012-06-05 23:23:03 +02:00
|
|
|
AllowTcpForwarding <%= scope.lookupvar('sshd::tcp_forwarding') %>
|
2011-01-19 23:13:39 +01:00
|
|
|
|
|
|
|
#GatewayPorts no
|
2012-06-05 23:23:03 +02:00
|
|
|
X11Forwarding <%= scope.lookupvar('sshd::x11_forwarding') %>
|
2011-01-19 23:13:39 +01:00
|
|
|
|
|
|
|
X11DisplayOffset 10
|
|
|
|
#X11UseLocalhost yes
|
2011-07-21 16:01:33 +02:00
|
|
|
PrintMotd <%= sshd_print_motd %>
|
2011-01-19 23:13:39 +01:00
|
|
|
#PrintLastLog yes
|
|
|
|
TCPKeepAlive yes
|
|
|
|
#UseLogin no
|
|
|
|
#UsePrivilegeSeparation yes
|
|
|
|
#PermitUserEnvironment no
|
|
|
|
#Compression delayed
|
|
|
|
#ClientAliveInterval 0
|
|
|
|
#ClientAliveCountMax 3
|
|
|
|
#UseDNS yes
|
|
|
|
#PidFile /var/run/sshd.pid
|
|
|
|
#MaxStartups 10
|
|
|
|
#PermitTunnel no
|
|
|
|
#ChrootDirectory none
|
|
|
|
|
|
|
|
# no default banner path
|
|
|
|
#Banner none
|
|
|
|
|
|
|
|
# override default of no subsystems
|
2012-06-05 23:23:03 +02:00
|
|
|
Subsystem sftp <%= (s=scope.lookupvar('sshd::sftp_subsystem')).empty? ? '/usr/libexec/sftp-server' : s %>
|
2011-01-19 23:13:39 +01:00
|
|
|
|
|
|
|
# Example of overriding settings on a per-user basis
|
|
|
|
#Match User anoncvs
|
|
|
|
# X11Forwarding no
|
|
|
|
# AllowTcpForwarding no
|
|
|
|
# ForceCommand cvs server
|
|
|
|
|
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 %>
|
2011-01-19 23:13:39 +01:00
|
|
|
<%- end -%>
|
|
|
|
|
2012-06-05 23:23:03 +02:00
|
|
|
<% if scope.lookupvar('sshd::hardened_ssl') == 'yes' -%>
|
2011-07-17 05:45:24 +02:00
|
|
|
Ciphers aes256-ctr
|
|
|
|
MACs hmac-sha1
|
2012-06-05 23:23:03 +02:00
|
|
|
<% end -%>
|
2011-01-19 23:13:39 +01:00
|
|
|
|
2012-06-05 23:23:03 +02:00
|
|
|
<% unless (s=scope.lookupvar('sshd::tail_additional_options')).empty? -%>
|
|
|
|
<%= s %>
|
|
|
|
<% end -%>
|