2008-01-02 19:02:20 +01:00
|
|
|
# $OpenBSD: sshd_config,v 1.74 2006/07/19 13:07:10 dtucker Exp $
|
|
|
|
|
|
|
|
# This is the sshd server system-wide configuration file. See
|
|
|
|
# sshd_config(5) for more information.
|
|
|
|
|
|
|
|
# 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.
|
|
|
|
|
2009-07-08 02:52:40 +02:00
|
|
|
<%- unless sshd_head_additional_options.to_s.empty? then %>
|
|
|
|
<%= sshd_head_additional_options %>
|
2008-09-30 00:37:26 +02:00
|
|
|
<%- end %>
|
|
|
|
|
2010-10-16 16:05:00 +02:00
|
|
|
<%- sshd_ports.each do |port| -%>
|
|
|
|
<%- if port.to_s == 'off' then -%>
|
2009-07-08 02:55:13 +02:00
|
|
|
#Port -- disabled by puppet
|
|
|
|
<% else -%>
|
2010-10-16 16:05:00 +02:00
|
|
|
Port <%= port -%>
|
2009-07-08 02:55:13 +02:00
|
|
|
<% end -%>
|
2010-10-16 16:05:00 +02:00
|
|
|
<%- end -%>
|
2009-07-08 02:55:13 +02:00
|
|
|
|
2008-09-30 00:37:26 +02:00
|
|
|
# Use these options to restrict which interfaces/protocols sshd will bind to
|
2008-10-21 00:46:50 +02:00
|
|
|
<% for address in sshd_listen_address -%>
|
2008-09-30 00:37:26 +02:00
|
|
|
ListenAddress <%= address %>
|
|
|
|
<% end -%>
|
2008-01-02 19:02:20 +01:00
|
|
|
#Protocol 2,1
|
|
|
|
#AddressFamily any
|
|
|
|
|
|
|
|
# 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 768
|
|
|
|
|
|
|
|
# Logging
|
|
|
|
# obsoletes QuietMode and FascistLogging
|
|
|
|
#SyslogFacility AUTH
|
|
|
|
#LogLevel INFO
|
|
|
|
|
|
|
|
# Authentication:
|
|
|
|
|
|
|
|
#LoginGraceTime 2m
|
2008-10-21 00:46:50 +02:00
|
|
|
<%- unless sshd_permit_root_login.to_s.empty? then %>
|
|
|
|
PermitRootLogin <%= sshd_permit_root_login %>
|
2008-06-13 23:01:39 +02:00
|
|
|
<%- else %>
|
|
|
|
PermitRootLogin without-password
|
|
|
|
<%- end %>
|
2008-09-30 00:37:26 +02:00
|
|
|
|
2008-10-21 00:46:50 +02:00
|
|
|
<%- if sshd_strict_modes.to_s == 'yes' then %>
|
2008-09-30 00:37:26 +02:00
|
|
|
StrictModes yes
|
|
|
|
<%- else %>
|
|
|
|
StrictModes no
|
|
|
|
<%- end %>
|
|
|
|
|
2008-01-02 19:02:20 +01:00
|
|
|
#MaxAuthTries 6
|
|
|
|
|
2008-10-21 00:46:50 +02:00
|
|
|
<%- if sshd_rsa_authentication.to_s == 'yes' then %>
|
2008-09-30 00:37:26 +02:00
|
|
|
RSAAuthentication yes
|
|
|
|
<%- else %>
|
|
|
|
RSAAuthentication no
|
|
|
|
<%- end %>
|
|
|
|
|
2008-10-21 00:46:50 +02:00
|
|
|
<%- if sshd_pubkey_authentication.to_s == 'yes' then %>
|
2008-09-30 00:37:26 +02:00
|
|
|
PubkeyAuthentication yes
|
|
|
|
<%- else %>
|
|
|
|
PubkeyAuthentication no
|
|
|
|
<%- end %>
|
|
|
|
|
2008-10-21 00:46:50 +02:00
|
|
|
<%- unless sshd_authorized_keys_file.to_s.empty? then %>
|
|
|
|
AuthorizedKeysFile <%= sshd_authorized_keys_file %>
|
2008-09-30 00:37:26 +02:00
|
|
|
<%- else %>
|
|
|
|
AuthorizedKeysFile %h/.ssh/authorized_keys
|
|
|
|
<%- end %>
|
2008-01-02 19:02:20 +01:00
|
|
|
|
|
|
|
# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
|
2008-10-21 00:46:50 +02:00
|
|
|
<%- if sshd_rhosts_rsa_authentication.to_s == 'yes' then %>
|
2008-09-30 00:37:26 +02:00
|
|
|
RhostsRSAAuthentication yes
|
|
|
|
<%- else %>
|
|
|
|
RhostsRSAAuthentication no
|
|
|
|
<% end -%>
|
|
|
|
|
2008-01-02 19:02:20 +01:00
|
|
|
# similar for protocol version 2
|
2008-10-21 00:46:50 +02:00
|
|
|
<%- if sshd_hostbased_authentication.to_s == 'yes' then %>
|
2008-09-30 00:37:26 +02:00
|
|
|
HostbasedAuthentication yes
|
|
|
|
<%- else %>
|
|
|
|
HostbasedAuthentication no
|
|
|
|
<% end -%>
|
|
|
|
|
2008-01-02 19:02:20 +01:00
|
|
|
# Change to yes if you don't trust ~/.ssh/known_hosts for
|
|
|
|
# RhostsRSAAuthentication and HostbasedAuthentication
|
|
|
|
#IgnoreUserKnownHosts no
|
2008-09-30 00:37:26 +02:00
|
|
|
|
2008-01-02 19:02:20 +01:00
|
|
|
# Don't read the user's ~/.rhosts and ~/.shosts files
|
2008-10-21 00:46:50 +02:00
|
|
|
<%- if sshd_ignore_rhosts.to_s == 'yes' then %>
|
2008-09-30 00:37:26 +02:00
|
|
|
IgnoreRhosts yes
|
|
|
|
<%- else %>
|
|
|
|
IgnoreRhosts no
|
|
|
|
<% end -%>
|
2008-01-02 19:02:20 +01:00
|
|
|
|
|
|
|
# To disable tunneled clear text passwords, change to no here!
|
2008-10-21 00:46:50 +02:00
|
|
|
<%- if sshd_password_authentication.to_s == 'yes' then %>
|
2008-06-13 23:01:39 +02:00
|
|
|
PasswordAuthentication yes
|
|
|
|
<%- else %>
|
2008-01-02 19:02:20 +01:00
|
|
|
PasswordAuthentication no
|
2008-06-13 23:01:39 +02:00
|
|
|
<%- end %>
|
2008-09-30 00:37:26 +02:00
|
|
|
|
|
|
|
# To enable empty passwords, change to yes (NOT RECOMMENDED)
|
2008-10-21 00:46:50 +02:00
|
|
|
<%- if sshd_permit_empty_passwords.to_s == 'yes' then %>
|
2008-09-30 00:37:26 +02:00
|
|
|
PermitEmptyPasswords yes
|
|
|
|
<% else -%>
|
|
|
|
PermitEmptyPasswords no
|
|
|
|
<% end -%>
|
2008-01-02 19:02:20 +01:00
|
|
|
|
|
|
|
# Change to no to disable s/key passwords
|
2008-10-21 00:46:50 +02:00
|
|
|
<%- if sshd_challenge_response_authentication.to_s == 'yes' then %>
|
2008-09-30 00:37:26 +02:00
|
|
|
ChallengeResponseAuthentication yes
|
|
|
|
<%- else %>
|
|
|
|
ChallengeResponseAuthentication no
|
|
|
|
<%- end %>
|
2008-01-02 19:02:20 +01:00
|
|
|
|
|
|
|
# Kerberos options
|
|
|
|
#KerberosAuthentication no
|
|
|
|
#KerberosOrLocalPasswd yes
|
|
|
|
#KerberosTicketCleanup yes
|
|
|
|
#KerberosGetAFSToken no
|
|
|
|
|
|
|
|
# GSSAPI options
|
|
|
|
#GSSAPIAuthentication no
|
|
|
|
#GSSAPICleanupCredentials yes
|
|
|
|
|
2008-10-21 00:46:50 +02:00
|
|
|
<%- if sshd_tcp_forwarding.to_s == 'yes' then %>
|
2008-09-30 00:37:26 +02:00
|
|
|
AllowTcpForwarding yes
|
|
|
|
<%- else %>
|
|
|
|
AllowTcpForwarding no
|
|
|
|
<%- end %>
|
|
|
|
|
2008-01-02 19:02:20 +01:00
|
|
|
#GatewayPorts no
|
2008-10-21 00:46:50 +02:00
|
|
|
<%- if sshd_x11_forwarding.to_s == 'yes' then %>
|
2008-06-13 23:01:39 +02:00
|
|
|
X11Forwarding yes
|
|
|
|
<%- else %>
|
|
|
|
X11Forwarding no
|
|
|
|
<%- end %>
|
2008-01-02 19:02:20 +01:00
|
|
|
#X11DisplayOffset 10
|
|
|
|
#X11UseLocalhost yes
|
|
|
|
#PrintMotd yes
|
|
|
|
#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
|
|
|
|
|
|
|
|
# no default banner path
|
|
|
|
#Banner /some/path
|
|
|
|
|
|
|
|
# override default of no subsystems
|
2008-10-21 00:46:50 +02:00
|
|
|
<%- if sshd_sftp_subsystem.to_s.empty? then %>
|
2008-01-02 19:02:20 +01:00
|
|
|
Subsystem sftp /usr/libexec/sftp-server
|
2008-10-21 00:46:50 +02:00
|
|
|
<%- else %>
|
|
|
|
Subsystem sftp <%= sshd_sftp_subsystem %>
|
|
|
|
<%- end %>
|
2008-01-02 19:02:20 +01:00
|
|
|
|
2008-10-21 00:46:50 +02:00
|
|
|
<%- unless sshd_allowed_users.to_s.empty? then %>
|
|
|
|
AllowUsers <%= sshd_allowed_users %>
|
|
|
|
<%- end %>
|
|
|
|
<%- unless sshd_allowed_groups.to_s.empty? then %>
|
|
|
|
AllowGroups <%= sshd_allowed_groups %>
|
2008-06-13 23:01:39 +02:00
|
|
|
<%- end %>
|
2008-01-02 19:02:20 +01:00
|
|
|
|
|
|
|
# Example of overriding settings on a per-user basis
|
|
|
|
#Match User anoncvs
|
|
|
|
# X11Forwarding no
|
|
|
|
# AllowTcpForwarding no
|
|
|
|
# ForceCommand cvs server
|
2008-10-21 00:46:50 +02:00
|
|
|
|
2009-07-08 02:52:40 +02:00
|
|
|
<%- unless sshd_tail_additional_options.to_s.empty? then %>
|
|
|
|
<%= sshd_tail_additional_options %>
|
2008-10-21 00:46:50 +02:00
|
|
|
<%- end %>
|