summaryrefslogtreecommitdiff
path: root/templates/sshd_config
diff options
context:
space:
mode:
Diffstat (limited to 'templates/sshd_config')
-rw-r--r--templates/sshd_config/CentOS_6.erb52
-rw-r--r--templates/sshd_config/CentOS_7.erb54
-rw-r--r--templates/sshd_config/Debian_jessie.erb67
-rw-r--r--templates/sshd_config/Debian_lenny.erb127
-rw-r--r--templates/sshd_config/Debian_sid.erb67
-rw-r--r--templates/sshd_config/Debian_squeeze.erb64
-rw-r--r--templates/sshd_config/Debian_wheezy.erb72
-rw-r--r--templates/sshd_config/FreeBSD.erb62
-rw-r--r--templates/sshd_config/Gentoo.erb52
-rw-r--r--templates/sshd_config/OpenBSD.erb50
-rw-r--r--templates/sshd_config/Ubuntu.erb68
-rw-r--r--templates/sshd_config/Ubuntu_lucid.erb58
l---------templates/sshd_config/XenServer_xenenterprise.erb (renamed from templates/sshd_config/RedHat_xenenterprise.erb)0
13 files changed, 364 insertions, 429 deletions
diff --git a/templates/sshd_config/CentOS_6.erb b/templates/sshd_config/CentOS_6.erb
index 47cb077..4593a91 100644
--- a/templates/sshd_config/CentOS_6.erb
+++ b/templates/sshd_config/CentOS_6.erb
@@ -10,11 +10,11 @@
# possible, but leave them commented. Uncommented options change a
# default value.
-<% unless (s=scope.lookupvar('sshd::head_additional_options')).empty? -%>
+<% unless (s=scope.lookupvar('::sshd::head_additional_options')).empty? -%>
<%= s %>
<% end -%>
-<% scope.lookupvar('sshd::ports').to_a.each do |port| -%>
+<% scope.lookupvar('::sshd::ports').to_a.each do |port| -%>
<% if port == 'off' -%>
#Port -- disabled by puppet
<% else -%>
@@ -23,7 +23,7 @@ Port <%= port %>
<% end -%>
# Use these options to restrict which interfaces/protocols sshd will bind to
-<% scope.lookupvar('sshd::listen_address').to_a.each do |address| -%>
+<% scope.lookupvar('::sshd::listen_address').to_a.each do |address| -%>
ListenAddress <%= address %>
<% end -%>
@@ -51,39 +51,39 @@ SyslogFacility AUTHPRIV
# Authentication:
#LoginGraceTime 2m
-PermitRootLogin <%= scope.lookupvar('sshd::permit_root_login') %>
+PermitRootLogin <%= scope.lookupvar('::sshd::permit_root_login') %>
-StrictModes <%= scope.lookupvar('sshd::strict_modes') %>
+StrictModes <%= scope.lookupvar('::sshd::strict_modes') %>
#MaxAuthTries 6
-RSAAuthentication <%= scope.lookupvar('sshd::rsa_authentication') %>
-PubkeyAuthentication <%= scope.lookupvar('sshd::pubkey_authentication') %>
-AuthorizedKeysFile <%= scope.lookupvar('sshd::authorized_keys_file') %>
+RSAAuthentication <%= scope.lookupvar('::sshd::rsa_authentication') %>
+PubkeyAuthentication <%= scope.lookupvar('::sshd::pubkey_authentication') %>
+AuthorizedKeysFile <%= scope.lookupvar('::sshd::authorized_keys_file') %>
#AuthorizedKeysCommand none
#AuthorizedKeysCommandRunAs nobody
# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
-RhostsRSAAuthentication <%= scope.lookupvar('sshd::rhosts_rsa_authentication') %>
+RhostsRSAAuthentication <%= scope.lookupvar('::sshd::rhosts_rsa_authentication') %>
# similar for protocol version 2
-HostbasedAuthentication <%= scope.lookupvar('sshd::hostbased_authentication') %>
+HostbasedAuthentication <%= scope.lookupvar('::sshd::hostbased_authentication') %>
# 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 <%= scope.lookupvar('sshd::ignore_rhosts') %>
+IgnoreRhosts <%= scope.lookupvar('::sshd::ignore_rhosts') %>
# To disable tunneled clear text passwords, change to no here!
-PasswordAuthentication <%= scope.lookupvar('sshd::password_authentication') %>
+PasswordAuthentication <%= scope.lookupvar('::sshd::password_authentication') %>
# To enable empty passwords, change to yes (NOT RECOMMENDED)
-PermitEmptyPasswords <%= scope.lookupvar('sshd::permit_empty_passwords') %>
+PermitEmptyPasswords <%= scope.lookupvar('::sshd::permit_empty_passwords') %>
# Change to no to disable s/key passwords
-ChallengeResponseAuthentication <%= scope.lookupvar('sshd::challenge_response_authentication') %>
+ChallengeResponseAuthentication <%= scope.lookupvar('::sshd::challenge_response_authentication') %>
# Kerberos options
#KerberosAuthentication no
@@ -106,7 +106,7 @@ ChallengeResponseAuthentication <%= scope.lookupvar('sshd::challenge_response_au
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to 'no'.
#UsePAM no
-UsePAM <%= scope.lookupvar('sshd::use_pam') %>
+UsePAM <%= scope.lookupvar('::sshd::use_pam') %>
# Accept locale-related environment variables
AcceptEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES
@@ -115,13 +115,13 @@ AcceptEnv LC_IDENTIFICATION LC_ALL LANGUAGE
AcceptEnv XMODIFIERS
#AllowAgentForwarding yes
-AllowTcpForwarding <%= scope.lookupvar('sshd::tcp_forwarding') %>
+AllowTcpForwarding <%= scope.lookupvar('::sshd::tcp_forwarding') %>
#GatewayPorts no
#X11Forwarding no
-X11Forwarding <%= scope.lookupvar('sshd::x11_forwarding') %>
+X11Forwarding <%= scope.lookupvar('::sshd::x11_forwarding') %>
#X11DisplayOffset 10
#X11UseLocalhost yes
-PrintMotd <%= scope.lookupvar('sshd::print_motd') %>
+PrintMotd <%= scope.lookupvar('::sshd::print_motd') %>
#PrintLastLog yes
#TCPKeepAlive yes
#UseLogin no
@@ -141,19 +141,25 @@ PrintMotd <%= scope.lookupvar('sshd::print_motd') %>
#Banner /some/path
# override default of no subsystems
-Subsystem sftp <%= (s=scope.lookupvar('sshd::sftp_subsystem')).empty? ? '/usr/libexec/openssh/sftp-server' : s %>
+Subsystem sftp <%= (s=scope.lookupvar('::sshd::sftp_subsystem')).empty? ? '/usr/libexec/openssh/sftp-server' : s %>
-<% unless (s=scope.lookupvar('sshd::allowed_users')).empty? -%>
+<% unless (s=scope.lookupvar('::sshd::allowed_users')).empty? -%>
AllowUsers <%= s %>
<% end -%>
-<% unless (s=scope.lookupvar('sshd::allowed_groups')).empty? -%>
+<% unless (s=scope.lookupvar('::sshd::allowed_groups')).empty? -%>
AllowGroups <%= s %>
<%- end -%>
-<% if scope.lookupvar('sshd::hardened_ssl') == 'yes' -%>
+<% if scope.lookupvar('::sshd::hardened') == 'yes' -%>
+<% if (scope.function_versioncmp([scope.lookupvar('::ssh_version'),'6.5'])) >= 0 -%>
+KexAlgorithms curve25519-sha256@libssh.org
+Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes256-ctr
+MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-ripemd160-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,hmac-ripemd160,umac-128@openssh.com
+<% else -%>
Ciphers aes256-ctr
MACs hmac-sha1
<% end -%>
+<% end -%>
# Example of overriding settings on a per-user basis
#Match User anoncvs
@@ -161,6 +167,6 @@ MACs hmac-sha1
# AllowTcpForwarding no
# ForceCommand cvs server
#
-<% unless (s=scope.lookupvar('sshd::tail_additional_options')).empty? -%>
+<% unless (s=scope.lookupvar('::sshd::tail_additional_options')).empty? -%>
<%= s %>
<% end -%>
diff --git a/templates/sshd_config/CentOS_7.erb b/templates/sshd_config/CentOS_7.erb
index 7db2277..f55fb9d 100644
--- a/templates/sshd_config/CentOS_7.erb
+++ b/templates/sshd_config/CentOS_7.erb
@@ -10,7 +10,7 @@
# possible, but leave them commented. Uncommented options change a
# default value.
-<% unless (s=scope.lookupvar('sshd::head_additional_options')).empty? -%>
+<% unless (s=scope.lookupvar('::sshd::head_additional_options')).empty? -%>
<%= s %>
<% end -%>
@@ -18,14 +18,14 @@
# SELinux about this change.
# semanage port -a -t ssh_port_t -p tcp #PORTNUMBER
#
-<% scope.lookupvar('sshd::ports').to_a.each do |port| -%>
+<% scope.lookupvar('::sshd::ports').to_a.each do |port| -%>
<% if port == 'off' -%>
#Port -- disabled by puppet
<% else -%>
Port <%= port %>
<% end -%>
<% end -%>
-<% scope.lookupvar('sshd::listen_address').to_a.each do |address| -%>
+<% scope.lookupvar('::sshd::listen_address').to_a.each do |address| -%>
ListenAddress <%= address %>
<% end -%>
@@ -35,7 +35,7 @@ ListenAddress <%= address %>
# HostKey for protocol version 1
#HostKey /etc/ssh/ssh_host_key
# HostKeys for protocol version 2
-<% scope.lookupvar('sshd::hostkey_type').to_a.each do |hostkey_type| -%>
+<% scope.lookupvar('::sshd::hostkey_type').to_a.each do |hostkey_type| -%>
HostKey /etc/ssh/ssh_host_<%=hostkey_type %>_key
<% end -%>
@@ -55,39 +55,39 @@ SyslogFacility AUTHPRIV
# Authentication:
#LoginGraceTime 2m
-PermitRootLogin <%= scope.lookupvar('sshd::permit_root_login') %>
-StrictModes <%= scope.lookupvar('sshd::strict_modes') %>
+PermitRootLogin <%= scope.lookupvar('::sshd::permit_root_login') %>
+StrictModes <%= scope.lookupvar('::sshd::strict_modes') %>
#MaxAuthTries 6
#MaxSessions 10
-RSAAuthentication <%= scope.lookupvar('sshd::rsa_authentication') %>
-PubkeyAuthentication <%= scope.lookupvar('sshd::pubkey_authentication') %>
-AuthorizedKeysFile <%= scope.lookupvar('sshd::authorized_keys_file') %>
+RSAAuthentication <%= scope.lookupvar('::sshd::rsa_authentication') %>
+PubkeyAuthentication <%= scope.lookupvar('::sshd::pubkey_authentication') %>
+AuthorizedKeysFile <%= scope.lookupvar('::sshd::authorized_keys_file') %>
#AuthorizedPrincipalsFile none
#AuthorizedKeysCommand none
#AuthorizedKeysCommandRunAs nobody
# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
-RhostsRSAAuthentication <%= scope.lookupvar('sshd::rhosts_rsa_authentication') %>
+RhostsRSAAuthentication <%= scope.lookupvar('::sshd::rhosts_rsa_authentication') %>
# similar for protocol version 2
-HostbasedAuthentication <%= scope.lookupvar('sshd::hostbased_authentication') %>
+HostbasedAuthentication <%= scope.lookupvar('::sshd::hostbased_authentication') %>
# 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 <%= scope.lookupvar('sshd::ignore_rhosts') %>
+IgnoreRhosts <%= scope.lookupvar('::sshd::ignore_rhosts') %>
# To disable tunneled clear text passwords, change to no here!
-PasswordAuthentication <%= scope.lookupvar('sshd::password_authentication') %>
+PasswordAuthentication <%= scope.lookupvar('::sshd::password_authentication') %>
# To enable empty passwords, change to yes (NOT RECOMMENDED)
-PermitEmptyPasswords <%= scope.lookupvar('sshd::permit_empty_passwords') %>
+PermitEmptyPasswords <%= scope.lookupvar('::sshd::permit_empty_passwords') %>
# Change to no to disable s/key passwords
-ChallengeResponseAuthentication <%= scope.lookupvar('sshd::challenge_response_authentication') %>
+ChallengeResponseAuthentication <%= scope.lookupvar('::sshd::challenge_response_authentication') %>
# Kerberos options
#KerberosAuthentication no
@@ -114,16 +114,16 @@ GSSAPICleanupCredentials yes
# WARNING: 'UsePAM no' is not supported in Red Hat Enterprise Linux and may cause several
# problems.
#UsePAM no
-UsePAM <%= scope.lookupvar('sshd::use_pam') %>
+UsePAM <%= scope.lookupvar('::sshd::use_pam') %>
#AllowAgentForwarding yes
-AllowTcpForwarding <%= scope.lookupvar('sshd::tcp_forwarding') %>
+AllowTcpForwarding <%= scope.lookupvar('::sshd::tcp_forwarding') %>
#GatewayPorts no
#X11Forwarding no
-X11Forwarding <%= scope.lookupvar('sshd::x11_forwarding') %>
+X11Forwarding <%= scope.lookupvar('::sshd::x11_forwarding') %>
#X11DisplayOffset 10
#X11UseLocalhost yes
-PrintMotd <%= scope.lookupvar('sshd::print_motd') %>
+PrintMotd <%= scope.lookupvar('::sshd::print_motd') %>
#PrintLastLog yes
#TCPKeepAlive yes
#UseLogin no
@@ -151,12 +151,12 @@ AcceptEnv XMODIFIERS
# override default of no subsystems
-Subsystem sftp <%= (s=scope.lookupvar('sshd::sftp_subsystem')).empty? ? '/usr/libexec/openssh/sftp-server' : s %>
+Subsystem sftp <%= (s=scope.lookupvar('::sshd::sftp_subsystem')).empty? ? '/usr/libexec/openssh/sftp-server' : s %>
-<% unless (s=scope.lookupvar('sshd::allowed_users')).empty? -%>
+<% unless (s=scope.lookupvar('::sshd::allowed_users')).empty? -%>
AllowUsers <%= s %>
<% end -%>
-<% unless (s=scope.lookupvar('sshd::allowed_groups')).empty? -%>
+<% unless (s=scope.lookupvar('::sshd::allowed_groups')).empty? -%>
AllowGroups <%= s %>
<%- end -%>
@@ -164,10 +164,16 @@ AllowGroups <%= s %>
#Host *.local
# CheckHostIP no
-<% if scope.lookupvar('sshd::hardened_ssl') == 'yes' -%>
+<% if scope.lookupvar('::sshd::hardened') == 'yes' -%>
+<% if (scope.function_versioncmp([scope.lookupvar('::ssh_version'),'6.5'])) >= 0 -%>
+KexAlgorithms curve25519-sha256@libssh.org
+Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes256-ctr
+MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-ripemd160-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,hmac-ripemd160,umac-128@openssh.com
+<% else -%>
Ciphers aes256-ctr
MACs hmac-sha1
<% end -%>
+<% end -%>
# Example of overriding settings on a per-user basis
#Match User anoncvs
@@ -175,6 +181,6 @@ MACs hmac-sha1
# AllowTcpForwarding no
# ForceCommand cvs server
-<% unless (s=scope.lookupvar('sshd::tail_additional_options')).empty? -%>
+<% unless (s=scope.lookupvar('::sshd::tail_additional_options')).empty? -%>
<%= s %>
<% end -%>
diff --git a/templates/sshd_config/Debian_jessie.erb b/templates/sshd_config/Debian_jessie.erb
index 033f409..91dbfff 100644
--- a/templates/sshd_config/Debian_jessie.erb
+++ b/templates/sshd_config/Debian_jessie.erb
@@ -3,12 +3,12 @@
# Package generated configuration file
# See the sshd_config(5) manpage for details
-<% unless (s=scope.lookupvar('sshd::head_additional_options')).empty? -%>
+<% unless (s=scope.lookupvar('::sshd::head_additional_options')).empty? -%>
<%= s %>
<% end -%>
# What ports, IPs and protocols we listen for
-<% scope.lookupvar('sshd::ports').to_a.each do |port| -%>
+<% scope.lookupvar('::sshd::ports').to_a.each do |port| -%>
<% if port == 'off' -%>
#Port -- disabled by puppet
<% else -%>
@@ -17,12 +17,12 @@ Port <%= port %>
<% end -%>
# Use these options to restrict which interfaces/protocols sshd will bind to
-<% scope.lookupvar('sshd::listen_address').to_a.each do |address| -%>
+<% scope.lookupvar('::sshd::listen_address').to_a.each do |address| -%>
ListenAddress <%= address %>
<% end -%>
Protocol 2
# HostKeys for protocol version 2
-<% scope.lookupvar('sshd::hostkey_type').to_a.each do |hostkey_type| -%>
+<% scope.lookupvar('::sshd::hostkey_type').to_a.each do |hostkey_type| -%>
HostKey /etc/ssh/ssh_host_<%=hostkey_type %>_key
<% end -%>
#Privilege Separation is turned on for security
@@ -38,56 +38,58 @@ LogLevel INFO
# Authentication:
LoginGraceTime 120
-PermitRootLogin <%= scope.lookupvar('sshd::permit_root_login') %>
-StrictModes <%= scope.lookupvar('sshd::strict_modes') %>
+PermitRootLogin <%= scope.lookupvar('::sshd::permit_root_login') %>
+StrictModes <%= scope.lookupvar('::sshd::strict_modes') %>
-RSAAuthentication <%= scope.lookupvar('sshd::rsa_authentication') %>
-PubkeyAuthentication <%= scope.lookupvar('sshd::pubkey_authentication') %>
-AuthorizedKeysFile <%= scope.lookupvar('sshd::authorized_keys_file') %>
+RSAAuthentication <%= scope.lookupvar('::sshd::rsa_authentication') %>
+PubkeyAuthentication <%= scope.lookupvar('::sshd::pubkey_authentication') %>
+AuthorizedKeysFile <%= scope.lookupvar('::sshd::authorized_keys_file') %>
# Don't read the user's ~/.rhosts and ~/.shosts files
-IgnoreRhosts <%= scope.lookupvar('sshd::ignore_rhosts') %>
+IgnoreRhosts <%= scope.lookupvar('::sshd::ignore_rhosts') %>
# For this to work you will also need host keys in /etc/ssh_known_hosts
-RhostsRSAAuthentication <%= scope.lookupvar('sshd::rhosts_rsa_authentication') %>
+RhostsRSAAuthentication <%= scope.lookupvar('::sshd::rhosts_rsa_authentication') %>
# similar for protocol version 2
-HostbasedAuthentication <%= scope.lookupvar('sshd::hostbased_authentication') %>
+HostbasedAuthentication <%= scope.lookupvar('::sshd::hostbased_authentication') %>
# Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
#IgnoreUserKnownHosts yes
# To enable empty passwords, change to yes (NOT RECOMMENDED)
-PermitEmptyPasswords <%= scope.lookupvar('sshd::permit_empty_passwords') %>
+PermitEmptyPasswords <%= scope.lookupvar('::sshd::permit_empty_passwords') %>
# Change to yes to enable challenge-response passwords (beware issues with
# some PAM modules and threads)
-ChallengeResponseAuthentication <%= scope.lookupvar('sshd::challenge_response_authentication') %>
+ChallengeResponseAuthentication <%= scope.lookupvar('::sshd::challenge_response_authentication') %>
# Change to no to disable tunnelled clear text passwords
-PasswordAuthentication <%= scope.lookupvar('sshd::password_authentication') %>
+PasswordAuthentication <%= scope.lookupvar('::sshd::password_authentication') %>
# Kerberos options
-KerberosAuthentication <%= scope.lookupvar('sshd::kerberos_authentication') %>
+KerberosAuthentication <%= scope.lookupvar('::sshd::kerberos_authentication') %>
#KerberosGetAFSToken no
-KerberosOrLocalPasswd <%= scope.lookupvar('sshd::kerberos_orlocalpasswd') %>
-KerberosTicketCleanup <%= scope.lookupvar('sshd::kerberos_ticketcleanup') %>
+KerberosOrLocalPasswd <%= scope.lookupvar('::sshd::kerberos_orlocalpasswd') %>
+KerberosTicketCleanup <%= scope.lookupvar('::sshd::kerberos_ticketcleanup') %>
# GSSAPI options
-GSSAPIAuthentication <%= scope.lookupvar('sshd::gssapi_authentication') %>
-GSSAPICleanupCredentials <%= scope.lookupvar('sshd::gssapi_cleanupcredentials') %>
+GSSAPIAuthentication <%= scope.lookupvar('::sshd::gssapi_authentication') %>
+GSSAPICleanupCredentials <%= scope.lookupvar('::sshd::gssapi_cleanupcredentials') %>
-X11Forwarding <%= scope.lookupvar('sshd::x11_forwarding') %>
+X11Forwarding <%= scope.lookupvar('::sshd::x11_forwarding') %>
X11DisplayOffset 10
-PrintMotd <%= scope.lookupvar('sshd::print_motd') %>
+PrintMotd <%= scope.lookupvar('::sshd::print_motd') %>
PrintLastLog yes
TCPKeepAlive yes
#UseLogin no
#MaxStartups 10:30:60
#Banner /etc/issue.net
+# do not reveal debian version (default is yes)
+DebianBanner no
# Allow client to pass locale environment variables
AcceptEnv LANG LC_*
-Subsystem sftp <%= (s=scope.lookupvar('sshd::sftp_subsystem')).empty? ? '/usr/lib/openssh/sftp-server' : s %>
+Subsystem sftp <%= (s=scope.lookupvar('::sshd::sftp_subsystem')).empty? ? '/usr/lib/openssh/sftp-server' : s %>
# Set this to 'yes' to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
@@ -98,24 +100,25 @@ Subsystem sftp <%= (s=scope.lookupvar('sshd::sftp_subsystem')).empty? ?
# 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'.
-UsePAM <%= scope.lookupvar('sshd::use_pam') %>
+UsePAM <%= scope.lookupvar('::sshd::use_pam') %>
-AllowTcpForwarding <%= scope.lookupvar('sshd::tcp_forwarding') %>
+AllowTcpForwarding <%= scope.lookupvar('::sshd::tcp_forwarding') %>
-AllowAgentForwarding <%= scope.lookupvar('sshd::agent_forwarding') %>
+AllowAgentForwarding <%= scope.lookupvar('::sshd::agent_forwarding') %>
-<% unless (s=scope.lookupvar('sshd::allowed_users')).empty? -%>
+<% unless (s=scope.lookupvar('::sshd::allowed_users')).empty? -%>
AllowUsers <%= s %>
<% end -%>
-<% unless (s=scope.lookupvar('sshd::allowed_groups')).empty? -%>
+<% unless (s=scope.lookupvar('::sshd::allowed_groups')).empty? -%>
AllowGroups <%= s %>
<%- end -%>
-<% if scope.lookupvar('sshd::hardened_ssl') == 'yes' -%>
-Ciphers aes256-ctr
-MACs hmac-sha1
+<% if scope.lookupvar('::sshd::hardened') == 'yes' -%>
+KexAlgorithms curve25519-sha256@libssh.org
+Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes256-ctr
+MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-ripemd160-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,hmac-ripemd160,umac-128@openssh.com
<% end -%>
-<% unless (s=scope.lookupvar('sshd::tail_additional_options')).empty? -%>
+<% unless (s=scope.lookupvar('::sshd::tail_additional_options')).empty? -%>
<%= s %>
<% end -%>
diff --git a/templates/sshd_config/Debian_lenny.erb b/templates/sshd_config/Debian_lenny.erb
deleted file mode 100644
index 8cbea30..0000000
--- a/templates/sshd_config/Debian_lenny.erb
+++ /dev/null
@@ -1,127 +0,0 @@
-# Package generated configuration file
-# See the sshd(8) manpage for details
-
-<% unless (s=scope.lookupvar('sshd::head_additional_options')).empty? -%>
-<%= s %>
-<% end -%>
-
-# What ports, IPs and protocols we listen for
-<% scope.lookupvar('sshd::ports').to_a.each do |port| -%>
-<% if port == 'off' -%>
-#Port -- disabled by puppet
-<% else -%>
-Port <%= port %>
-<% end -%>
-<% end -%>
-
-# Use these options to restrict which interfaces/protocols sshd will bind to
-<% scope.lookupvar('sshd::listen_address').to_a.each do |address| -%>
-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
-PermitRootLogin <%= scope.lookupvar('sshd::permit_root_login') %>
-
-StrictModes <%= scope.lookupvar('sshd::strict_modes') %>
-
-RSAAuthentication <%= scope.lookupvar('sshd::rsa_authentication') %>
-
-PubkeyAuthentication <%= scope.lookupvar('sshd::pubkey_authentication') %>
-
-AuthorizedKeysFile <%= scope.lookupvar('sshd::authorized_keys_file') %>
-
-# For this to work you will also need host keys in /etc/ssh_known_hosts
-RhostsRSAAuthentication <%= scope.lookupvar('sshd::rhosts_rsa_authentication') %>
-
-# Don't read the user's ~/.rhosts and ~/.shosts files
-IgnoreRhosts <%= scope.lookupvar('sshd::ignore_rhosts') %>
-
-# similar for protocol version 2
-HostbasedAuthentication <%= scope.lookupvar('sshd::hostbased_authentication') %>
-
-# Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
-#IgnoreUserKnownHosts yes
-
-# To enable empty passwords, change to yes (NOT RECOMMENDED)
-PermitEmptyPasswords <%= scope.lookupvar('sshd::permit_empty_passwords') %>
-
-# Change to no to disable s/key passwords
-ChallengeResponseAuthentication <%= scope.lookupvar('sshd::challenge_response_authentication') %>
-
-# To disable tunneled clear text passwords, change to no here!
-PasswordAuthentication <%= scope.lookupvar('sshd::password_authentication') %>
-
-# To change Kerberos options
-#KerberosAuthentication no
-#KerberosOrLocalPasswd yes
-#AFSTokenPassing no
-#KerberosTicketCleanup no
-
-# Kerberos TGT Passing does only work with the AFS kaserver
-#KerberosTgtPassing yes
-
-X11Forwarding <%= scope.lookupvar('sshd::x11_forwarding') %>
-X11DisplayOffset 10
-KeepAlive yes
-#UseLogin no
-
-#MaxStartups 10:30:60
-#Banner /etc/issue.net
-#ReverseMappingCheck yes
-
-# Allow client to pass locale environment variables
-AcceptEnv LANG LC_*
-
-Subsystem sftp <%= (s=scope.lookupvar('sshd::sftp_subsystem')).empty? ? '/usr/lib/openssh/sftp-server' : s %>
-
-# 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'.
-UsePAM <%= scope.lookupvar('sshd::use_pam') %>
-
-AllowTcpForwarding <%= scope.lookupvar('sshd::tcp_forwarding') %>
-
-AllowAgentForwarding <%= scope.lookupvar('sshd::agent_forwarding') %>
-
-<% unless (s=scope.lookupvar('sshd::allowed_users')).empty? -%>
-AllowUsers <%= s %>
-<% end -%>
-<% unless (s=scope.lookupvar('sshd::allowed_groups')).empty? -%>
-AllowGroups <%= s %>
-<%- end -%>
-
-PrintMotd <%= scope.lookupvar('sshd::print_motd') %>
-
-<% if scope.lookupvar('sshd::hardened_ssl') == 'yes' -%>
-Ciphers aes256-ctr
-MACs hmac-sha1
-<% end -%>
-
-<% unless (s=scope.lookupvar('sshd::tail_additional_options')).empty? -%>
-<%= s %>
-<% end -%>
diff --git a/templates/sshd_config/Debian_sid.erb b/templates/sshd_config/Debian_sid.erb
index 033f409..91dbfff 100644
--- a/templates/sshd_config/Debian_sid.erb
+++ b/templates/sshd_config/Debian_sid.erb
@@ -3,12 +3,12 @@
# Package generated configuration file
# See the sshd_config(5) manpage for details
-<% unless (s=scope.lookupvar('sshd::head_additional_options')).empty? -%>
+<% unless (s=scope.lookupvar('::sshd::head_additional_options')).empty? -%>
<%= s %>
<% end -%>
# What ports, IPs and protocols we listen for
-<% scope.lookupvar('sshd::ports').to_a.each do |port| -%>
+<% scope.lookupvar('::sshd::ports').to_a.each do |port| -%>
<% if port == 'off' -%>
#Port -- disabled by puppet
<% else -%>
@@ -17,12 +17,12 @@ Port <%= port %>
<% end -%>
# Use these options to restrict which interfaces/protocols sshd will bind to
-<% scope.lookupvar('sshd::listen_address').to_a.each do |address| -%>
+<% scope.lookupvar('::sshd::listen_address').to_a.each do |address| -%>
ListenAddress <%= address %>
<% end -%>
Protocol 2
# HostKeys for protocol version 2
-<% scope.lookupvar('sshd::hostkey_type').to_a.each do |hostkey_type| -%>
+<% scope.lookupvar('::sshd::hostkey_type').to_a.each do |hostkey_type| -%>
HostKey /etc/ssh/ssh_host_<%=hostkey_type %>_key
<% end -%>
#Privilege Separation is turned on for security
@@ -38,56 +38,58 @@ LogLevel INFO
# Authentication:
LoginGraceTime 120
-PermitRootLogin <%= scope.lookupvar('sshd::permit_root_login') %>
-StrictModes <%= scope.lookupvar('sshd::strict_modes') %>
+PermitRootLogin <%= scope.lookupvar('::sshd::permit_root_login') %>
+StrictModes <%= scope.lookupvar('::sshd::strict_modes') %>
-RSAAuthentication <%= scope.lookupvar('sshd::rsa_authentication') %>
-PubkeyAuthentication <%= scope.lookupvar('sshd::pubkey_authentication') %>
-AuthorizedKeysFile <%= scope.lookupvar('sshd::authorized_keys_file') %>
+RSAAuthentication <%= scope.lookupvar('::sshd::rsa_authentication') %>
+PubkeyAuthentication <%= scope.lookupvar('::sshd::pubkey_authentication') %>
+AuthorizedKeysFile <%= scope.lookupvar('::sshd::authorized_keys_file') %>
# Don't read the user's ~/.rhosts and ~/.shosts files
-IgnoreRhosts <%= scope.lookupvar('sshd::ignore_rhosts') %>
+IgnoreRhosts <%= scope.lookupvar('::sshd::ignore_rhosts') %>
# For this to work you will also need host keys in /etc/ssh_known_hosts
-RhostsRSAAuthentication <%= scope.lookupvar('sshd::rhosts_rsa_authentication') %>
+RhostsRSAAuthentication <%= scope.lookupvar('::sshd::rhosts_rsa_authentication') %>
# similar for protocol version 2
-HostbasedAuthentication <%= scope.lookupvar('sshd::hostbased_authentication') %>
+HostbasedAuthentication <%= scope.lookupvar('::sshd::hostbased_authentication') %>
# Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
#IgnoreUserKnownHosts yes
# To enable empty passwords, change to yes (NOT RECOMMENDED)
-PermitEmptyPasswords <%= scope.lookupvar('sshd::permit_empty_passwords') %>
+PermitEmptyPasswords <%= scope.lookupvar('::sshd::permit_empty_passwords') %>
# Change to yes to enable challenge-response passwords (beware issues with
# some PAM modules and threads)
-ChallengeResponseAuthentication <%= scope.lookupvar('sshd::challenge_response_authentication') %>
+ChallengeResponseAuthentication <%= scope.lookupvar('::sshd::challenge_response_authentication') %>
# Change to no to disable tunnelled clear text passwords
-PasswordAuthentication <%= scope.lookupvar('sshd::password_authentication') %>
+PasswordAuthentication <%= scope.lookupvar('::sshd::password_authentication') %>
# Kerberos options
-KerberosAuthentication <%= scope.lookupvar('sshd::kerberos_authentication') %>
+KerberosAuthentication <%= scope.lookupvar('::sshd::kerberos_authentication') %>
#KerberosGetAFSToken no
-KerberosOrLocalPasswd <%= scope.lookupvar('sshd::kerberos_orlocalpasswd') %>
-KerberosTicketCleanup <%= scope.lookupvar('sshd::kerberos_ticketcleanup') %>
+KerberosOrLocalPasswd <%= scope.lookupvar('::sshd::kerberos_orlocalpasswd') %>
+KerberosTicketCleanup <%= scope.lookupvar('::sshd::kerberos_ticketcleanup') %>
# GSSAPI options
-GSSAPIAuthentication <%= scope.lookupvar('sshd::gssapi_authentication') %>
-GSSAPICleanupCredentials <%= scope.lookupvar('sshd::gssapi_cleanupcredentials') %>
+GSSAPIAuthentication <%= scope.lookupvar('::sshd::gssapi_authentication') %>
+GSSAPICleanupCredentials <%= scope.lookupvar('::sshd::gssapi_cleanupcredentials') %>
-X11Forwarding <%= scope.lookupvar('sshd::x11_forwarding') %>
+X11Forwarding <%= scope.lookupvar('::sshd::x11_forwarding') %>
X11DisplayOffset 10
-PrintMotd <%= scope.lookupvar('sshd::print_motd') %>
+PrintMotd <%= scope.lookupvar('::sshd::print_motd') %>
PrintLastLog yes
TCPKeepAlive yes
#UseLogin no
#MaxStartups 10:30:60
#Banner /etc/issue.net
+# do not reveal debian version (default is yes)
+DebianBanner no
# Allow client to pass locale environment variables
AcceptEnv LANG LC_*
-Subsystem sftp <%= (s=scope.lookupvar('sshd::sftp_subsystem')).empty? ? '/usr/lib/openssh/sftp-server' : s %>
+Subsystem sftp <%= (s=scope.lookupvar('::sshd::sftp_subsystem')).empty? ? '/usr/lib/openssh/sftp-server' : s %>
# Set this to 'yes' to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
@@ -98,24 +100,25 @@ Subsystem sftp <%= (s=scope.lookupvar('sshd::sftp_subsystem')).empty? ?
# 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'.
-UsePAM <%= scope.lookupvar('sshd::use_pam') %>
+UsePAM <%= scope.lookupvar('::sshd::use_pam') %>
-AllowTcpForwarding <%= scope.lookupvar('sshd::tcp_forwarding') %>
+AllowTcpForwarding <%= scope.lookupvar('::sshd::tcp_forwarding') %>
-AllowAgentForwarding <%= scope.lookupvar('sshd::agent_forwarding') %>
+AllowAgentForwarding <%= scope.lookupvar('::sshd::agent_forwarding') %>
-<% unless (s=scope.lookupvar('sshd::allowed_users')).empty? -%>
+<% unless (s=scope.lookupvar('::sshd::allowed_users')).empty? -%>
AllowUsers <%= s %>
<% end -%>
-<% unless (s=scope.lookupvar('sshd::allowed_groups')).empty? -%>
+<% unless (s=scope.lookupvar('::sshd::allowed_groups')).empty? -%>
AllowGroups <%= s %>
<%- end -%>
-<% if scope.lookupvar('sshd::hardened_ssl') == 'yes' -%>
-Ciphers aes256-ctr
-MACs hmac-sha1
+<% if scope.lookupvar('::sshd::hardened') == 'yes' -%>
+KexAlgorithms curve25519-sha256@libssh.org
+Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes256-ctr
+MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-ripemd160-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,hmac-ripemd160,umac-128@openssh.com
<% end -%>
-<% unless (s=scope.lookupvar('sshd::tail_additional_options')).empty? -%>
+<% unless (s=scope.lookupvar('::sshd::tail_additional_options')).empty? -%>
<%= s %>
<% end -%>
diff --git a/templates/sshd_config/Debian_squeeze.erb b/templates/sshd_config/Debian_squeeze.erb
index 0ba323f..649b320 100644
--- a/templates/sshd_config/Debian_squeeze.erb
+++ b/templates/sshd_config/Debian_squeeze.erb
@@ -3,12 +3,12 @@
# Package generated configuration file
# See the sshd(8) manpage for details
-<% unless (s=scope.lookupvar('sshd::head_additional_options')).empty? -%>
+<% unless (s=scope.lookupvar('::sshd::head_additional_options')).empty? -%>
<%= s %>
<% end -%>
# What ports, IPs and protocols we listen for
-<% scope.lookupvar('sshd::ports').to_a.each do |port| -%>
+<% scope.lookupvar('::sshd::ports').to_a.each do |port| -%>
<% if port == 'off' -%>
#Port -- disabled by puppet
<% else -%>
@@ -17,12 +17,12 @@ Port <%= port %>
<% end -%>
# Use these options to restrict which interfaces/protocols sshd will bind to
-<% scope.lookupvar('sshd::listen_address').to_a.each do |address| -%>
+<% scope.lookupvar('::sshd::listen_address').to_a.each do |address| -%>
ListenAddress <%= address %>
<% end -%>
Protocol 2
# HostKeys for protocol version 2
-<% scope.lookupvar('sshd::hostkey_type').to_a.each do |hostkey_type| -%>
+<% scope.lookupvar('::sshd::hostkey_type').to_a.each do |hostkey_type| -%>
HostKey /etc/ssh/ssh_host_<%=hostkey_type %>_key
<% end -%>
@@ -39,47 +39,47 @@ LogLevel INFO
# Authentication:
LoginGraceTime 120
-PermitRootLogin <%= scope.lookupvar('sshd::permit_root_login') %>
+PermitRootLogin <%= scope.lookupvar('::sshd::permit_root_login') %>
-StrictModes <%= scope.lookupvar('sshd::strict_modes') %>
+StrictModes <%= scope.lookupvar('::sshd::strict_modes') %>
-RSAAuthentication <%= scope.lookupvar('sshd::rsa_authentication') %>
+RSAAuthentication <%= scope.lookupvar('::sshd::rsa_authentication') %>
-PubkeyAuthentication <%= scope.lookupvar('sshd::pubkey_authentication') %>
+PubkeyAuthentication <%= scope.lookupvar('::sshd::pubkey_authentication') %>
-AuthorizedKeysFile <%= scope.lookupvar('sshd::authorized_keys_file') %>
+AuthorizedKeysFile <%= scope.lookupvar('::sshd::authorized_keys_file') %>
# Don't read the user's ~/.rhosts and ~/.shosts files
-IgnoreRhosts <%= scope.lookupvar('sshd::ignore_rhosts') %>
+IgnoreRhosts <%= scope.lookupvar('::sshd::ignore_rhosts') %>
# For this to work you will also need host keys in /etc/ssh_known_hosts
-RhostsRSAAuthentication <%= scope.lookupvar('sshd::rhosts_rsa_authentication') %>
+RhostsRSAAuthentication <%= scope.lookupvar('::sshd::rhosts_rsa_authentication') %>
# similar for protocol version 2
-HostbasedAuthentication <%= scope.lookupvar('sshd::hostbased_authentication') %>
+HostbasedAuthentication <%= scope.lookupvar('::sshd::hostbased_authentication') %>
# Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
#IgnoreUserKnownHosts yes
# To enable empty passwords, change to yes (NOT RECOMMENDED)
-PermitEmptyPasswords <%= scope.lookupvar('sshd::permit_empty_passwords') %>
+PermitEmptyPasswords <%= scope.lookupvar('::sshd::permit_empty_passwords') %>
# Change to yes to enable challenge-response passwords (beware issues with
# some PAM modules and threads)
-ChallengeResponseAuthentication <%= scope.lookupvar('sshd::challenge_response_authentication') %>
+ChallengeResponseAuthentication <%= scope.lookupvar('::sshd::challenge_response_authentication') %>
# To disable tunneled clear text passwords, change to no here!
-PasswordAuthentication <%= scope.lookupvar('sshd::password_authentication') %>
+PasswordAuthentication <%= scope.lookupvar('::sshd::password_authentication') %>
# Kerberos options
-KerberosAuthentication <%= scope.lookupvar('sshd::kerberos_authentication') %>
-KerberosOrLocalPasswd <%= scope.lookupvar('sshd::kerberos_orlocalpasswd') %>
-KerberosTicketCleanup <%= scope.lookupvar('sshd::kerberos_ticketcleanup') %>
+KerberosAuthentication <%= scope.lookupvar('::sshd::kerberos_authentication') %>
+KerberosOrLocalPasswd <%= scope.lookupvar('::sshd::kerberos_orlocalpasswd') %>
+KerberosTicketCleanup <%= scope.lookupvar('::sshd::kerberos_ticketcleanup') %>
# GSSAPI options
-GSSAPIAuthentication <%= scope.lookupvar('sshd::gssapi_authentication') %>
-GSSAPICleanupCredentials <%= scope.lookupvar('sshd::gssapi_cleanupcredentials') %>
+GSSAPIAuthentication <%= scope.lookupvar('::sshd::gssapi_authentication') %>
+GSSAPICleanupCredentials <%= scope.lookupvar('::sshd::gssapi_cleanupcredentials') %>
-X11Forwarding <%= scope.lookupvar('sshd::x11_forwarding') %>
+X11Forwarding <%= scope.lookupvar('::sshd::x11_forwarding') %>
X11DisplayOffset 10
-PrintMotd <%= scope.lookupvar('sshd::print_motd') %>
+PrintMotd <%= scope.lookupvar('::sshd::print_motd') %>
PrintLastLog yes
TCPKeepAlive yes
@@ -87,11 +87,13 @@ TCPKeepAlive yes
#MaxStartups 10:30:60
#Banner /etc/issue.net
+# do not reveal debian version (default is yes)
+DebianBanner no
# Allow client to pass locale environment variables
AcceptEnv LANG LC_*
-Subsystem sftp <%= (s=scope.lookupvar('sshd::sftp_subsystem')).empty? ? '/usr/lib/openssh/sftp-server' : s %>
+Subsystem sftp <%= (s=scope.lookupvar('::sshd::sftp_subsystem')).empty? ? '/usr/lib/openssh/sftp-server' : s %>
# Set this to 'yes' to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
@@ -102,24 +104,24 @@ Subsystem sftp <%= (s=scope.lookupvar('sshd::sftp_subsystem')).empty? ?
# 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'.
-UsePAM <%= scope.lookupvar('sshd::use_pam') %>
+UsePAM <%= scope.lookupvar('::sshd::use_pam') %>
-AllowTcpForwarding <%= scope.lookupvar('sshd::tcp_forwarding') %>
+AllowTcpForwarding <%= scope.lookupvar('::sshd::tcp_forwarding') %>
-AllowAgentForwarding <%= scope.lookupvar('sshd::agent_forwarding') %>
+AllowAgentForwarding <%= scope.lookupvar('::sshd::agent_forwarding') %>
-<% unless (s=scope.lookupvar('sshd::allowed_users')).empty? -%>
+<% unless (s=scope.lookupvar('::sshd::allowed_users')).empty? -%>
AllowUsers <%= s %>
<% end -%>
-<% unless (s=scope.lookupvar('sshd::allowed_groups')).empty? -%>
+<% unless (s=scope.lookupvar('::sshd::allowed_groups')).empty? -%>
AllowGroups <%= s %>
<%- end -%>
-<% if scope.lookupvar('sshd::hardened_ssl') == 'yes' -%>
+<% if scope.lookupvar('::sshd::hardened') == 'yes' -%>
Ciphers aes256-ctr
-MACs hmac-sha1
+MACs hmac-sha2-512
<% end -%>
-<% unless (s=scope.lookupvar('sshd::tail_additional_options')).empty? -%>
+<% unless (s=scope.lookupvar('::sshd::tail_additional_options')).empty? -%>
<%= s %>
<% end -%>
diff --git a/templates/sshd_config/Debian_wheezy.erb b/templates/sshd_config/Debian_wheezy.erb
index cd4bf48..bcb1528 100644
--- a/templates/sshd_config/Debian_wheezy.erb
+++ b/templates/sshd_config/Debian_wheezy.erb
@@ -3,12 +3,12 @@
# Package generated configuration file
# See the sshd(8) manpage for details
-<% unless (s=scope.lookupvar('sshd::head_additional_options')).empty? -%>
+<% unless (s=scope.lookupvar('::sshd::head_additional_options')).empty? -%>
<%= s %>
<% end -%>
# What ports, IPs and protocols we listen for
-<% scope.lookupvar('sshd::ports').to_a.each do |port| -%>
+<% scope.lookupvar('::sshd::ports').to_a.each do |port| -%>
<% if port == 'off' -%>
#Port -- disabled by puppet
<% else -%>
@@ -17,12 +17,12 @@ Port <%= port %>
<% end -%>
# Use these options to restrict which interfaces/protocols sshd will bind to
-<% scope.lookupvar('sshd::listen_address').to_a.each do |address| -%>
+<% scope.lookupvar('::sshd::listen_address').to_a.each do |address| -%>
ListenAddress <%= address %>
<% end -%>
Protocol 2
# HostKeys for protocol version 2
-<% scope.lookupvar('sshd::hostkey_type').to_a.each do |hostkey_type| -%>
+<% scope.lookupvar('::sshd::hostkey_type').to_a.each do |hostkey_type| -%>
HostKey /etc/ssh/ssh_host_<%=hostkey_type %>_key
<% end -%>
#Privilege Separation is turned on for security
@@ -37,48 +37,48 @@ SyslogFacility AUTH
LogLevel INFO
# Authentication:
-LoginGraceTime 600
-PermitRootLogin <%= scope.lookupvar('sshd::permit_root_login') %>
+LoginGraceTime 120
+PermitRootLogin <%= scope.lookupvar('::sshd::permit_root_login') %>
-StrictModes <%= scope.lookupvar('sshd::strict_modes') %>
+StrictModes <%= scope.lookupvar('::sshd::strict_modes') %>
-RSAAuthentication <%= scope.lookupvar('sshd::rsa_authentication') %>
+RSAAuthentication <%= scope.lookupvar('::sshd::rsa_authentication') %>
-PubkeyAuthentication <%= scope.lookupvar('sshd::pubkey_authentication') %>
+PubkeyAuthentication <%= scope.lookupvar('::sshd::pubkey_authentication') %>
-AuthorizedKeysFile <%= scope.lookupvar('sshd::authorized_keys_file') %>
+AuthorizedKeysFile <%= scope.lookupvar('::sshd::authorized_keys_file') %>
# Don't read the user's ~/.rhosts and ~/.shosts files
-IgnoreRhosts <%= scope.lookupvar('sshd::ignore_rhosts') %>
+IgnoreRhosts <%= scope.lookupvar('::sshd::ignore_rhosts') %>
# For this to work you will also need host keys in /etc/ssh_known_hosts
-RhostsRSAAuthentication <%= scope.lookupvar('sshd::rhosts_rsa_authentication') %>
+RhostsRSAAuthentication <%= scope.lookupvar('::sshd::rhosts_rsa_authentication') %>
# similar for protocol version 2
-HostbasedAuthentication <%= scope.lookupvar('sshd::hostbased_authentication') %>
+HostbasedAuthentication <%= scope.lookupvar('::sshd::hostbased_authentication') %>
# Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
#IgnoreUserKnownHosts yes
# To enable empty passwords, change to yes (NOT RECOMMENDED)
-PermitEmptyPasswords <%= scope.lookupvar('sshd::permit_empty_passwords') %>
+PermitEmptyPasswords <%= scope.lookupvar('::sshd::permit_empty_passwords') %>
# Change to yes to enable challenge-response passwords (beware issues with
# some PAM modules and threads)
-ChallengeResponseAuthentication <%= scope.lookupvar('sshd::challenge_response_authentication') %>
+ChallengeResponseAuthentication <%= scope.lookupvar('::sshd::challenge_response_authentication') %>
# To disable tunneled clear text passwords, change to no here!
-PasswordAuthentication <%= scope.lookupvar('sshd::password_authentication') %>
+PasswordAuthentication <%= scope.lookupvar('::sshd::password_authentication') %>
# Kerberos options
-KerberosAuthentication <%= scope.lookupvar('sshd::kerberos_authentication') %>
-KerberosOrLocalPasswd <%= scope.lookupvar('sshd::kerberos_orlocalpasswd') %>
-KerberosTicketCleanup <%= scope.lookupvar('sshd::kerberos_ticketcleanup') %>
+KerberosAuthentication <%= scope.lookupvar('::sshd::kerberos_authentication') %>
+KerberosOrLocalPasswd <%= scope.lookupvar('::sshd::kerberos_orlocalpasswd') %>
+KerberosTicketCleanup <%= scope.lookupvar('::sshd::kerberos_ticketcleanup') %>
# GSSAPI options
-GSSAPIAuthentication <%= scope.lookupvar('sshd::gssapi_authentication') %>
-GSSAPICleanupCredentials <%= scope.lookupvar('sshd::gssapi_cleanupcredentials') %>
+GSSAPIAuthentication <%= scope.lookupvar('::sshd::gssapi_authentication') %>
+GSSAPICleanupCredentials <%= scope.lookupvar('::sshd::gssapi_cleanupcredentials') %>
-X11Forwarding <%= scope.lookupvar('sshd::x11_forwarding') %>
+X11Forwarding <%= scope.lookupvar('::sshd::x11_forwarding') %>
X11DisplayOffset 10
-PrintMotd <%= scope.lookupvar('sshd::print_motd') %>
+PrintMotd <%= scope.lookupvar('::sshd::print_motd') %>
PrintLastLog yes
TCPKeepAlive yes
@@ -86,11 +86,13 @@ TCPKeepAlive yes
#MaxStartups 10:30:60
#Banner /etc/issue.net
+# do not reveal debian version (default is yes)
+DebianBanner no
# Allow client to pass locale environment variables
AcceptEnv LANG LC_*
-Subsystem sftp <%= (s=scope.lookupvar('sshd::sftp_subsystem')).empty? ? '/usr/lib/openssh/sftp-server' : s %>
+Subsystem sftp <%= (s=scope.lookupvar('::sshd::sftp_subsystem')).empty? ? '/usr/lib/openssh/sftp-server' : s %>
# Set this to 'yes' to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
@@ -101,24 +103,30 @@ Subsystem sftp <%= (s=scope.lookupvar('sshd::sftp_subsystem')).empty? ?
# 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'.
-UsePAM <%= scope.lookupvar('sshd::use_pam') %>
+UsePAM <%= scope.lookupvar('::sshd::use_pam') %>
-AllowTcpForwarding <%= scope.lookupvar('sshd::tcp_forwarding') %>
+AllowTcpForwarding <%= scope.lookupvar('::sshd::tcp_forwarding') %>
-AllowAgentForwarding <%= scope.lookupvar('sshd::agent_forwarding') %>
+AllowAgentForwarding <%= scope.lookupvar('::sshd::agent_forwarding') %>
-<% unless (s=scope.lookupvar('sshd::allowed_users')).empty? -%>
+<% unless (s=scope.lookupvar('::sshd::allowed_users')).empty? -%>
AllowUsers <%= s %>
<% end -%>
-<% unless (s=scope.lookupvar('sshd::allowed_groups')).empty? -%>
+<% unless (s=scope.lookupvar('::sshd::allowed_groups')).empty? -%>
AllowGroups <%= s %>
<%- end -%>
-<% if scope.lookupvar('sshd::hardened_ssl') == 'yes' -%>
+<% if scope.lookupvar('::sshd::hardened') == 'yes' -%>
+<% if (scope.function_versioncmp([scope.lookupvar('::ssh_version'),'6.5'])) >= 0 -%>
+KexAlgorithms curve25519-sha256@libssh.org
+Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes256-ctr
+MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-ripemd160-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,hmac-ripemd160,umac-128@openssh.com
+<% else -%>
Ciphers aes256-ctr
-MACs hmac-sha1
+MACs hmac-sha2-512
+<% end -%>
<% end -%>
-<% unless (s=scope.lookupvar('sshd::tail_additional_options')).empty? -%>
+<% unless (s=scope.lookupvar('::sshd::tail_additional_options')).empty? -%>
<%= s %>
<% end -%>
diff --git a/templates/sshd_config/FreeBSD.erb b/templates/sshd_config/FreeBSD.erb
index d4cd9b5..5298ade 100644
--- a/templates/sshd_config/FreeBSD.erb
+++ b/templates/sshd_config/FreeBSD.erb
@@ -16,12 +16,12 @@
#VersionAddendum FreeBSD-20100308
-<% unless (s=scope.lookupvar('sshd::head_additional_options')).empty? -%>
+<% unless (s=scope.lookupvar('::sshd::head_additional_options')).empty? -%>
<%= s %>
<% end -%>
# What ports, IPs and protocols we listen for
-<% scope.lookupvar('sshd::ports').to_a.each do |port| -%>
+<% scope.lookupvar('::sshd::ports').to_a.each do |port| -%>
<% if port == 'off' -%>
#Port -- disabled by puppet
<% else -%>
@@ -30,7 +30,7 @@ Port <%= port %>
<% end -%>
#AddressFamily any
-<% scope.lookupvar('sshd::listen_address').to_a.each do |address| -%>
+<% scope.lookupvar('::sshd::listen_address').to_a.each do |address| -%>
ListenAddress <%= address %>
<% end -%>
@@ -40,7 +40,7 @@ Protocol 2
# HostKey for protocol version 1
#HostKey /etc/ssh/ssh_host_key
# HostKeys for protocol version 2
-<% scope.lookupvar('sshd::hostkey_type').to_a.each do |hostkey_type| -%>
+<% scope.lookupvar('::sshd::hostkey_type').to_a.each do |hostkey_type| -%>
HostKey /etc/ssh/ssh_host_<%=hostkey_type %>_key
<% end -%>
@@ -56,24 +56,24 @@ LogLevel INFO
# Authentication:
LoginGraceTime 600
-PermitRootLogin <%= scope.lookupvar('sshd::permit_root_login') %>
+PermitRootLogin <%= scope.lookupvar('::sshd::permit_root_login') %>
-StrictModes <%= scope.lookupvar('sshd::strict_modes') %>
+StrictModes <%= scope.lookupvar('::sshd::strict_modes') %>
#MaxAuthTries 6
#MaxSessions 10
-RSAAuthentication <%= scope.lookupvar('sshd::rsa_authentication') %>
+RSAAuthentication <%= scope.lookupvar('::sshd::rsa_authentication') %>
-PubkeyAuthentication <%= scope.lookupvar('sshd::pubkey_authentication') %>
+PubkeyAuthentication <%= scope.lookupvar('::sshd::pubkey_authentication') %>
-AuthorizedKeysFile <%= scope.lookupvar('sshd::authorized_keys_file') %>
+AuthorizedKeysFile <%= scope.lookupvar('::sshd::authorized_keys_file') %>
# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
-RhostsRSAAuthentication <%= scope.lookupvar('sshd::rhosts_rsa_authentication') %>
+RhostsRSAAuthentication <%= scope.lookupvar('::sshd::rhosts_rsa_authentication') %>
# similar for protocol version 2
-HostbasedAuthentication <%= scope.lookupvar('sshd::hostbased_authentication') %>
+HostbasedAuthentication <%= scope.lookupvar('::sshd::hostbased_authentication') %>
# Change to yes if you don't trust ~/.ssh/known_hosts for
# RhostsRSAAuthentication and HostbasedAuthentication
@@ -82,21 +82,21 @@ HostbasedAuthentication <%= scope.lookupvar('sshd::hostbased_authentication') %>
#IgnoreRhosts yes
# Change to yes to enable built-in password authentication.
-PasswordAuthentication <%= scope.lookupvar('sshd::password_authentication') %>
+PasswordAuthentication <%= scope.lookupvar('::sshd::password_authentication') %>
-PermitEmptyPasswords <%= scope.lookupvar('sshd::permit_empty_passwords') %>
+PermitEmptyPasswords <%= scope.lookupvar('::sshd::permit_empty_passwords') %>
# Change to no to disable PAM authentication
-ChallengeResponseAuthentication <%= scope.lookupvar('sshd::challenge_response_authentication') %>
+ChallengeResponseAuthentication <%= scope.lookupvar('::sshd::challenge_response_authentication') %>
# Kerberos options
-KerberosAuthentication <%= scope.lookupvar('sshd::kerberos_authentication') %>
-KerberosOrLocalPasswd <%= scope.lookupvar('sshd::kerberos_orlocalpasswd') %>
-KerberosTicketCleanup <%= scope.lookupvar('sshd::kerberos_ticketcleanup') %>
+KerberosAuthentication <%= scope.lookupvar('::sshd::kerberos_authentication') %>
+KerberosOrLocalPasswd <%= scope.lookupvar('::sshd::kerberos_orlocalpasswd') %>
+KerberosTicketCleanup <%= scope.lookupvar('::sshd::kerberos_ticketcleanup') %>
# GSSAPI options
-GSSAPIAuthentication <%= scope.lookupvar('sshd::gssapi_authentication') %>
-GSSAPICleanupCredentials <%= scope.lookupvar('sshd::gssapi_cleanupcredentials') %>
+GSSAPIAuthentication <%= scope.lookupvar('::sshd::gssapi_authentication') %>
+GSSAPICleanupCredentials <%= scope.lookupvar('::sshd::gssapi_cleanupcredentials') %>
# Set this to 'no' to disable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
@@ -107,14 +107,14 @@ GSSAPICleanupCredentials <%= scope.lookupvar('sshd::gssapi_cleanupcredentials')
# 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'.
-UsePAM <%= scope.lookupvar('sshd::use_pam') %>
+UsePAM <%= scope.lookupvar('::sshd::use_pam') %>
-AllowAgentForwarding <%= scope.lookupvar('sshd::agent_forwarding') %>
+AllowAgentForwarding <%= scope.lookupvar('::sshd::agent_forwarding') %>
-AllowTcpForwarding <%= scope.lookupvar('sshd::tcp_forwarding') %>
+AllowTcpForwarding <%= scope.lookupvar('::sshd::tcp_forwarding') %>
#GatewayPorts no
-X11Forwarding <%= scope.lookupvar('sshd::x11_forwarding') %>
+X11Forwarding <%= scope.lookupvar('::sshd::x11_forwarding') %>
X11DisplayOffset 10
#X11UseLocalhost yes
@@ -137,7 +137,7 @@ TCPKeepAlive yes
#Banner none
# override default of no subsystems
-Subsystem sftp <%= (s=scope.lookupvar('sshd::sftp_subsystem')).empty? ? '/usr/libexec/sftp-server' : s %>
+Subsystem sftp <%= (s=scope.lookupvar('::sshd::sftp_subsystem')).empty? ? '/usr/libexec/sftp-server' : s %>
# Example of overriding settings on a per-user basis
#Match User anoncvs
@@ -145,18 +145,24 @@ Subsystem sftp <%= (s=scope.lookupvar('sshd::sftp_subsystem')).empty? ?
# AllowTcpForwarding no
# ForceCommand cvs server
-<% unless (s=scope.lookupvar('sshd::allowed_users')).empty? -%>
+<% unless (s=scope.lookupvar('::sshd::allowed_users')).empty? -%>
AllowUsers <%= s %>
<% end -%>
-<% unless (s=scope.lookupvar('sshd::allowed_groups')).empty? -%>
+<% unless (s=scope.lookupvar('::sshd::allowed_groups')).empty? -%>
AllowGroups <%= s %>
<%- end -%>
-<% if scope.lookupvar('sshd::hardened_ssl') == 'yes' -%>
+<% if scope.lookupvar('::sshd::hardened') == 'yes' -%>
+<% if (scope.function_versioncmp([scope.lookupvar('::ssh_version'),'6.5'])) >= 0 -%>
+KexAlgorithms curve25519-sha256@libssh.org
+Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes256-ctr
+MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-ripemd160-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,hmac-ripemd160,umac-128@openssh.com
+<% else -%>
Ciphers aes256-ctr
MACs hmac-sha1
<% end -%>
+<% end -%>
-<% unless (s=scope.lookupvar('sshd::tail_additional_options')).empty? -%>
+<% unless (s=scope.lookupvar('::sshd::tail_additional_options')).empty? -%>
<%= s %>
<% end -%>
diff --git a/templates/sshd_config/Gentoo.erb b/templates/sshd_config/Gentoo.erb
index 1cb4522..022a26e 100644
--- a/templates/sshd_config/Gentoo.erb
+++ b/templates/sshd_config/Gentoo.erb
@@ -10,11 +10,11 @@
# possible, but leave them commented. Uncommented options change a
# default value.
-<% unless (s=scope.lookupvar('sshd::head_additional_options')).empty? -%>
+<% unless (s=scope.lookupvar('::sshd::head_additional_options')).empty? -%>
<%= s %>
<% end -%>
-<% scope.lookupvar('sshd::ports').to_a.each do |port| -%>
+<% scope.lookupvar('::sshd::ports').to_a.each do |port| -%>
<% if port == 'off' -%>
#Port -- disabled by puppet
<% else -%>
@@ -23,7 +23,7 @@ Port <%= port %>
<% end -%>
# Use these options to restrict which interfaces/protocols sshd will bind to
-<% scope.lookupvar('sshd::listen_address').to_a.each do |address| -%>
+<% scope.lookupvar('::sshd::listen_address').to_a.each do |address| -%>
ListenAddress <%= address %>
<% end -%>
#AddressFamily any
@@ -51,39 +51,39 @@ Protocol 2
# Authentication:
#LoginGraceTime 2m
-PermitRootLogin <%= scope.lookupvar('sshd::permit_root_login') %>
+PermitRootLogin <%= scope.lookupvar('::sshd::permit_root_login') %>
-StrictModes <%= scope.lookupvar('sshd::strict_modes') %>
+StrictModes <%= scope.lookupvar('::sshd::strict_modes') %>
#MaxAuthTries 6
-RSAAuthentication <%= scope.lookupvar('sshd::rsa_authentication') %>
+RSAAuthentication <%= scope.lookupvar('::sshd::rsa_authentication') %>
-PubkeyAuthentication <%= scope.lookupvar('sshd::pubkey_authentication') %>
+PubkeyAuthentication <%= scope.lookupvar('::sshd::pubkey_authentication') %>
-AuthorizedKeysFile <%= scope.lookupvar('sshd::authorized_keys_file') %>
+AuthorizedKeysFile <%= scope.lookupvar('::sshd::authorized_keys_file') %>
# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
-RhostsRSAAuthentication <%= scope.lookupvar('sshd::rhosts_rsa_authentication') %>
+RhostsRSAAuthentication <%= scope.lookupvar('::sshd::rhosts_rsa_authentication') %>
# similar for protocol version 2
-HostbasedAuthentication <%= scope.lookupvar('sshd::hostbased_authentication') %>
+HostbasedAuthentication <%= scope.lookupvar('::sshd::hostbased_authentication') %>
# 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 <%= scope.lookupvar('sshd::ignore_rhosts') %>
+IgnoreRhosts <%= scope.lookupvar('::sshd::ignore_rhosts') %>
# To disable tunneled clear text passwords, change to no here!
-PasswordAuthentication <%= scope.lookupvar('sshd::password_authentication') %>
+PasswordAuthentication <%= scope.lookupvar('::sshd::password_authentication') %>
# To enable empty passwords, change to yes (NOT RECOMMENDED)
-PermitEmptyPasswords <%= scope.lookupvar('sshd::permit_empty_passwords') %>
+PermitEmptyPasswords <%= scope.lookupvar('::sshd::permit_empty_passwords') %>
# Change to no to disable s/key passwords
-ChallengeResponseAuthentication <%= scope.lookupvar('sshd::challenge_response_authentication') %>
+ChallengeResponseAuthentication <%= scope.lookupvar('::sshd::challenge_response_authentication') %>
# Kerberos options
#KerberosAuthentication no
@@ -106,15 +106,15 @@ ChallengeResponseAuthentication <%= scope.lookupvar('sshd::challenge_response_au
# 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'.
-UsePAM <%= scope.lookupvar('sshd::use_pam') %>
+UsePAM <%= scope.lookupvar('::sshd::use_pam') %>
-AllowTcpForwarding <%= scope.lookupvar('sshd::tcp_forwarding') %>
+AllowTcpForwarding <%= scope.lookupvar('::sshd::tcp_forwarding') %>
#GatewayPorts no
-X11Forwarding <%= scope.lookupvar('sshd::x11_forwarding') %>
+X11Forwarding <%= scope.lookupvar('::sshd::x11_forwarding') %>
#X11DisplayOffset 10
#X11UseLocalhost yes
-PrintMotd <%= scope.lookupvar('sshd::print_motd') %>
+PrintMotd <%= scope.lookupvar('::sshd::print_motd') %>
#PrintLastLog yes
#TCPKeepAlive yes
#UseLogin no
@@ -132,7 +132,7 @@ PrintMotd <%= scope.lookupvar('sshd::print_motd') %>
#Banner /some/path
# override default of no subsystems
-Subsystem sftp <%= (s=scope.lookupvar('sshd::sftp_subsystem')).empty? ? '/usr/lib/misc/sftp-server' : s %>
+Subsystem sftp <%= (s=scope.lookupvar('::sshd::sftp_subsystem')).empty? ? '/usr/lib/misc/sftp-server' : s %>
# Example of overriding settings on a per-user basis
#Match User anoncvs
@@ -140,19 +140,25 @@ Subsystem sftp <%= (s=scope.lookupvar('sshd::sftp_subsystem')).empty? ?
# AllowTcpForwarding no
# ForceCommand cvs server
-<% unless (s=scope.lookupvar('sshd::allowed_users')).empty? -%>
+<% unless (s=scope.lookupvar('::sshd::allowed_users')).empty? -%>
AllowUsers <%= s %>
<% end -%>
-<% unless (s=scope.lookupvar('sshd::allowed_groups')).empty? -%>
+<% unless (s=scope.lookupvar('::sshd::allowed_groups')).empty? -%>
AllowGroups <%= s %>
<%- end -%>
-<% if scope.lookupvar('sshd::hardened_ssl') == 'yes' -%>
+<% if scope.lookupvar('::sshd::hardened') == 'yes' -%>
+<% if (scope.function_versioncmp([scope.lookupvar('::ssh_version'),'6.5'])) >= 0 -%>
+KexAlgorithms curve25519-sha256@libssh.org
+Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes256-ctr
+MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-ripemd160-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,hmac-ripemd160,umac-128@openssh.com
+<% else -%>
Ciphers aes256-ctr
MACs hmac-sha1
<% end -%>
+<% end -%>
-<% unless (s=scope.lookupvar('sshd::tail_additional_options')).empty? -%>
+<% unless (s=scope.lookupvar('::sshd::tail_additional_options')).empty? -%>
<%= s %>
<% end -%>
diff --git a/templates/sshd_config/OpenBSD.erb b/templates/sshd_config/OpenBSD.erb
index aa92eb6..db73030 100644
--- a/templates/sshd_config/OpenBSD.erb
+++ b/templates/sshd_config/OpenBSD.erb
@@ -8,11 +8,11 @@
# possible, but leave them commented. Uncommented options change a
# default value.
-<% unless (s=scope.lookupvar('sshd::head_additional_options')).empty? -%>
+<% unless (s=scope.lookupvar('::sshd::head_additional_options')).empty? -%>
<%= s %>
<% end -%>
-<% scope.lookupvar('sshd::ports').to_a.each do |port| -%>
+<% scope.lookupvar('::sshd::ports').to_a.each do |port| -%>
<% if port == 'off' -%>
#Port -- disabled by puppet
<% else -%>
@@ -21,7 +21,7 @@ Port <%= port %>
<% end -%>
# Use these options to restrict which interfaces/protocols sshd will bind to
-<% scope.lookupvar('sshd::listen_address').to_a.each do |address| -%>
+<% scope.lookupvar('::sshd::listen_address').to_a.each do |address| -%>
ListenAddress <%= address %>
<% end -%>
#Protocol 2,1
@@ -45,39 +45,39 @@ ListenAddress <%= address %>
# Authentication:
#LoginGraceTime 2m
-PermitRootLogin <%= scope.lookupvar('sshd::permit_root_login') %>
+PermitRootLogin <%= scope.lookupvar('::sshd::permit_root_login') %>
-StrictModes <%= scope.lookupvar('sshd::strict_modes') %>
+StrictModes <%= scope.lookupvar('::sshd::strict_modes') %>
#MaxAuthTries 6
-RSAAuthentication <%= scope.lookupvar('sshd::rsa_authentication') %>
+RSAAuthentication <%= scope.lookupvar('::sshd::rsa_authentication') %>
-PubkeyAuthentication <%= scope.lookupvar('sshd::pubkey_authentication') %>
+PubkeyAuthentication <%= scope.lookupvar('::sshd::pubkey_authentication') %>
-AuthorizedKeysFile <%= scope.lookupvar('sshd::authorized_keys_file') %>
+AuthorizedKeysFile <%= scope.lookupvar('::sshd::authorized_keys_file') %>
# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
-RhostsRSAAuthentication <%= scope.lookupvar('sshd::rhosts_rsa_authentication') %>
+RhostsRSAAuthentication <%= scope.lookupvar('::sshd::rhosts_rsa_authentication') %>
# similar for protocol version 2
-HostbasedAuthentication <%= scope.lookupvar('sshd::hostbased_authentication') %>
+HostbasedAuthentication <%= scope.lookupvar('::sshd::hostbased_authentication') %>
# 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 <%= scope.lookupvar('sshd::ignore_rhosts') %>
+IgnoreRhosts <%= scope.lookupvar('::sshd::ignore_rhosts') %>
# To disable tunneled clear text passwords, change to no here!
-PasswordAuthentication <%= scope.lookupvar('sshd::password_authentication') %>
+PasswordAuthentication <%= scope.lookupvar('::sshd::password_authentication') %>
# To enable empty passwords, change to yes (NOT RECOMMENDED)
-PermitEmptyPasswords <%= scope.lookupvar('sshd::permit_empty_passwords') %>
+PermitEmptyPasswords <%= scope.lookupvar('::sshd::permit_empty_passwords') %>
# Change to no to disable s/key passwords
-ChallengeResponseAuthentication <%= scope.lookupvar('sshd::challenge_response_authentication') %>
+ChallengeResponseAuthentication <%= scope.lookupvar('::sshd::challenge_response_authentication') %>
# Kerberos options
#KerberosAuthentication no
@@ -89,13 +89,13 @@ ChallengeResponseAuthentication <%= scope.lookupvar('sshd::challenge_response_au
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes
-AllowTcpForwarding <%= scope.lookupvar('sshd::tcp_forwarding') %>
+AllowTcpForwarding <%= scope.lookupvar('::sshd::tcp_forwarding') %>
#GatewayPorts no
-X11Forwarding <%= scope.lookupvar('sshd::x11_forwarding') %>
+X11Forwarding <%= scope.lookupvar('::sshd::x11_forwarding') %>
#X11DisplayOffset 10
#X11UseLocalhost yes
-PrintMotd <%= scope.lookupvar('sshd::print_motd') %>
+PrintMotd <%= scope.lookupvar('::sshd::print_motd') %>
#PrintLastLog yes
#TCPKeepAlive yes
#UseLogin no
@@ -113,12 +113,12 @@ PrintMotd <%= scope.lookupvar('sshd::print_motd') %>
#Banner /some/path
# override default of no subsystems
-Subsystem sftp <%= (s=scope.lookupvar('sshd::sftp_subsystem')).empty? ? '/usr/libexec/sftp-server' : s %>
+Subsystem sftp <%= (s=scope.lookupvar('::sshd::sftp_subsystem')).empty? ? '/usr/libexec/sftp-server' : s %>
-<% unless (s=scope.lookupvar('sshd::allowed_users')).empty? -%>
+<% unless (s=scope.lookupvar('::sshd::allowed_users')).empty? -%>
AllowUsers <%= s %>
<% end -%>
-<% unless (s=scope.lookupvar('sshd::allowed_groups')).empty? -%>
+<% unless (s=scope.lookupvar('::sshd::allowed_groups')).empty? -%>
AllowGroups <%= s %>
<%- end -%>
@@ -128,11 +128,17 @@ AllowGroups <%= s %>
# AllowTcpForwarding no
# ForceCommand cvs server
-<% if scope.lookupvar('sshd::hardened_ssl') == 'yes' -%>
+<% if scope.lookupvar('::sshd::hardened') == 'yes' -%>
+<% if (scope.function_versioncmp([scope.lookupvar('::ssh_version'),'6.5'])) >= 0 -%>
+KexAlgorithms curve25519-sha256@libssh.org
+Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes256-ctr
+MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-ripemd160-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,hmac-ripemd160,umac-128@openssh.com
+<% else -%>
Ciphers aes256-ctr
MACs hmac-sha1
<% end -%>
+<% end -%>
-<% unless (s=scope.lookupvar('sshd::tail_additional_options')).empty? -%>
+<% unless (s=scope.lookupvar('::sshd::tail_additional_options')).empty? -%>
<%= s %>
<% end -%>
diff --git a/templates/sshd_config/Ubuntu.erb b/templates/sshd_config/Ubuntu.erb
index 0ba323f..a326ab8 100644
--- a/templates/sshd_config/Ubuntu.erb
+++ b/templates/sshd_config/Ubuntu.erb
@@ -3,12 +3,12 @@
# Package generated configuration file
# See the sshd(8) manpage for details
-<% unless (s=scope.lookupvar('sshd::head_additional_options')).empty? -%>
+<% unless (s=scope.lookupvar('::sshd::head_additional_options')).empty? -%>
<%= s %>
<% end -%>
# What ports, IPs and protocols we listen for
-<% scope.lookupvar('sshd::ports').to_a.each do |port| -%>
+<% scope.lookupvar('::sshd::ports').to_a.each do |port| -%>
<% if port == 'off' -%>
#Port -- disabled by puppet
<% else -%>
@@ -17,12 +17,12 @@ Port <%= port %>
<% end -%>
# Use these options to restrict which interfaces/protocols sshd will bind to
-<% scope.lookupvar('sshd::listen_address').to_a.each do |address| -%>
+<% scope.lookupvar('::sshd::listen_address').to_a.each do |address| -%>
ListenAddress <%= address %>
<% end -%>
Protocol 2
# HostKeys for protocol version 2
-<% scope.lookupvar('sshd::hostkey_type').to_a.each do |hostkey_type| -%>
+<% scope.lookupvar('::sshd::hostkey_type').to_a.each do |hostkey_type| -%>
HostKey /etc/ssh/ssh_host_<%=hostkey_type %>_key
<% end -%>
@@ -39,47 +39,47 @@ LogLevel INFO
# Authentication:
LoginGraceTime 120
-PermitRootLogin <%= scope.lookupvar('sshd::permit_root_login') %>
+PermitRootLogin <%= scope.lookupvar('::sshd::permit_root_login') %>
-StrictModes <%= scope.lookupvar('sshd::strict_modes') %>
+StrictModes <%= scope.lookupvar('::sshd::strict_modes') %>
-RSAAuthentication <%= scope.lookupvar('sshd::rsa_authentication') %>
+RSAAuthentication <%= scope.lookupvar('::sshd::rsa_authentication') %>
-PubkeyAuthentication <%= scope.lookupvar('sshd::pubkey_authentication') %>
+PubkeyAuthentication <%= scope.lookupvar('::sshd::pubkey_authentication') %>
-AuthorizedKeysFile <%= scope.lookupvar('sshd::authorized_keys_file') %>
+AuthorizedKeysFile <%= scope.lookupvar('::sshd::authorized_keys_file') %>
# Don't read the user's ~/.rhosts and ~/.shosts files
-IgnoreRhosts <%= scope.lookupvar('sshd::ignore_rhosts') %>
+IgnoreRhosts <%= scope.lookupvar('::sshd::ignore_rhosts') %>
# For this to work you will also need host keys in /etc/ssh_known_hosts
-RhostsRSAAuthentication <%= scope.lookupvar('sshd::rhosts_rsa_authentication') %>
+RhostsRSAAuthentication <%= scope.lookupvar('::sshd::rhosts_rsa_authentication') %>
# similar for protocol version 2
-HostbasedAuthentication <%= scope.lookupvar('sshd::hostbased_authentication') %>
+HostbasedAuthentication <%= scope.lookupvar('::sshd::hostbased_authentication') %>
# Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
#IgnoreUserKnownHosts yes
# To enable empty passwords, change to yes (NOT RECOMMENDED)
-PermitEmptyPasswords <%= scope.lookupvar('sshd::permit_empty_passwords') %>
+PermitEmptyPasswords <%= scope.lookupvar('::sshd::permit_empty_passwords') %>
# Change to yes to enable challenge-response passwords (beware issues with
# some PAM modules and threads)
-ChallengeResponseAuthentication <%= scope.lookupvar('sshd::challenge_response_authentication') %>
+ChallengeResponseAuthentication <%= scope.lookupvar('::sshd::challenge_response_authentication') %>
# To disable tunneled clear text passwords, change to no here!
-PasswordAuthentication <%= scope.lookupvar('sshd::password_authentication') %>
+PasswordAuthentication <%= scope.lookupvar('::sshd::password_authentication') %>
# Kerberos options
-KerberosAuthentication <%= scope.lookupvar('sshd::kerberos_authentication') %>
-KerberosOrLocalPasswd <%= scope.lookupvar('sshd::kerberos_orlocalpasswd') %>
-KerberosTicketCleanup <%= scope.lookupvar('sshd::kerberos_ticketcleanup') %>
+KerberosAuthentication <%= scope.lookupvar('::sshd::kerberos_authentication') %>
+KerberosOrLocalPasswd <%= scope.lookupvar('::sshd::kerberos_orlocalpasswd') %>
+KerberosTicketCleanup <%= scope.lookupvar('::sshd::kerberos_ticketcleanup') %>
# GSSAPI options
-GSSAPIAuthentication <%= scope.lookupvar('sshd::gssapi_authentication') %>
-GSSAPICleanupCredentials <%= scope.lookupvar('sshd::gssapi_cleanupcredentials') %>
+GSSAPIAuthentication <%= scope.lookupvar('::sshd::gssapi_authentication') %>
+GSSAPICleanupCredentials <%= scope.lookupvar('::sshd::gssapi_cleanupcredentials') %>
-X11Forwarding <%= scope.lookupvar('sshd::x11_forwarding') %>
+X11Forwarding <%= scope.lookupvar('::sshd::x11_forwarding') %>
X11DisplayOffset 10
-PrintMotd <%= scope.lookupvar('sshd::print_motd') %>
+PrintMotd <%= scope.lookupvar('::sshd::print_motd') %>
PrintLastLog yes
TCPKeepAlive yes
@@ -87,11 +87,13 @@ TCPKeepAlive yes
#MaxStartups 10:30:60
#Banner /etc/issue.net
+# do not reveal debian version (default is yes)
+DebianBanner no
# Allow client to pass locale environment variables
AcceptEnv LANG LC_*
-Subsystem sftp <%= (s=scope.lookupvar('sshd::sftp_subsystem')).empty? ? '/usr/lib/openssh/sftp-server' : s %>
+Subsystem sftp <%= (s=scope.lookupvar('::sshd::sftp_subsystem')).empty? ? '/usr/lib/openssh/sftp-server' : s %>
# Set this to 'yes' to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
@@ -102,24 +104,30 @@ Subsystem sftp <%= (s=scope.lookupvar('sshd::sftp_subsystem')).empty? ?
# 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'.
-UsePAM <%= scope.lookupvar('sshd::use_pam') %>
+UsePAM <%= scope.lookupvar('::sshd::use_pam') %>
-AllowTcpForwarding <%= scope.lookupvar('sshd::tcp_forwarding') %>
+AllowTcpForwarding <%= scope.lookupvar('::sshd::tcp_forwarding') %>
-AllowAgentForwarding <%= scope.lookupvar('sshd::agent_forwarding') %>
+AllowAgentForwarding <%= scope.lookupvar('::sshd::agent_forwarding') %>
-<% unless (s=scope.lookupvar('sshd::allowed_users')).empty? -%>
+<% unless (s=scope.lookupvar('::sshd::allowed_users')).empty? -%>
AllowUsers <%= s %>
<% end -%>
-<% unless (s=scope.lookupvar('sshd::allowed_groups')).empty? -%>
+<% unless (s=scope.lookupvar('::sshd::allowed_groups')).empty? -%>
AllowGroups <%= s %>
<%- end -%>
-<% if scope.lookupvar('sshd::hardened_ssl') == 'yes' -%>
+<% if scope.lookupvar('::sshd::hardened') == 'yes' -%>
+<% if (scope.function_versioncmp([scope.lookupvar('::ssh_version'),'6.5'])) >= 0 -%>
+KexAlgorithms curve25519-sha256@libssh.org
+Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes256-ctr
+MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-ripemd160-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,hmac-ripemd160,umac-128@openssh.com
+<% else -%>
Ciphers aes256-ctr
MACs hmac-sha1
<% end -%>
+<% end -%>
-<% unless (s=scope.lookupvar('sshd::tail_additional_options')).empty? -%>
+<% unless (s=scope.lookupvar('::sshd::tail_additional_options')).empty? -%>
<%= s %>
<% end -%>
diff --git a/templates/sshd_config/Ubuntu_lucid.erb b/templates/sshd_config/Ubuntu_lucid.erb
index cff95a7..be7c56d 100644
--- a/templates/sshd_config/Ubuntu_lucid.erb
+++ b/templates/sshd_config/Ubuntu_lucid.erb
@@ -1,12 +1,12 @@
# Package generated configuration file
# See the sshd(8) manpage for details
-<% unless (s=scope.lookupvar('sshd::head_additional_options')).empty? -%>
+<% unless (s=scope.lookupvar('::sshd::head_additional_options')).empty? -%>
<%= s %>
<% end -%>
# What ports, IPs and protocols we listen for
-<% scope.lookupvar('sshd::ports').to_a.each do |port| -%>
+<% scope.lookupvar('::sshd::ports').to_a.each do |port| -%>
<% if port == 'off' -%>
#Port -- disabled by puppet
<% else -%>
@@ -15,12 +15,12 @@ Port <%= port %>
<% end -%>
# Use these options to restrict which interfaces/protocols sshd will bind to
-<% scope.lookupvar('sshd::listen_address').to_a.each do |address| -%>
+<% scope.lookupvar('::sshd::listen_address').to_a.each do |address| -%>
ListenAddress <%= address %>
<% end -%>
Protocol 2
# HostKeys for protocol version 2
-<% scope.lookupvar('sshd::hostkey_type').to_a.each do |hostkey_type| -%>
+<% scope.lookupvar('::sshd::hostkey_type').to_a.each do |hostkey_type| -%>
HostKey /etc/ssh/ssh_host_<%=hostkey_type %>_key
<% end -%>
@@ -41,36 +41,36 @@ LogLevel INFO
# Authentication:
LoginGraceTime 600
-PermitRootLogin <%= scope.lookupvar('sshd::permit_root_login') %>
+PermitRootLogin <%= scope.lookupvar('::sshd::permit_root_login') %>
-StrictModes <%= scope.lookupvar('sshd::strict_modes') %>
+StrictModes <%= scope.lookupvar('::sshd::strict_modes') %>
-RSAAuthentication <%= scope.lookupvar('sshd::rsa_authentication') %>
+RSAAuthentication <%= scope.lookupvar('::sshd::rsa_authentication') %>
-PubkeyAuthentication <%= scope.lookupvar('sshd::pubkey_authentication') %>
+PubkeyAuthentication <%= scope.lookupvar('::sshd::pubkey_authentication') %>
-AuthorizedKeysFile <%= scope.lookupvar('sshd::authorized_keys_file') %>
+AuthorizedKeysFile <%= scope.lookupvar('::sshd::authorized_keys_file') %>
# For this to work you will also need host keys in /etc/ssh_known_hosts
-RhostsRSAAuthentication <%= scope.lookupvar('sshd::rhosts_rsa_authentication') %>
+RhostsRSAAuthentication <%= scope.lookupvar('::sshd::rhosts_rsa_authentication') %>
# Don't read the user's ~/.rhosts and ~/.shosts files
-IgnoreRhosts <%= scope.lookupvar('sshd::ignore_rhosts') %>
+IgnoreRhosts <%= scope.lookupvar('::sshd::ignore_rhosts') %>
# similar for protocol version 2
-HostbasedAuthentication <%= scope.lookupvar('sshd::hostbased_authentication') %>
+HostbasedAuthentication <%= scope.lookupvar('::sshd::hostbased_authentication') %>
# Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
#IgnoreUserKnownHosts yes
# To enable empty passwords, change to yes (NOT RECOMMENDED)
-PermitEmptyPasswords <%= scope.lookupvar('sshd::permit_empty_passwords') %>
+PermitEmptyPasswords <%= scope.lookupvar('::sshd::permit_empty_passwords') %>
# Change to no to disable s/key passwords
-ChallengeResponseAuthentication <%= scope.lookupvar('sshd::challenge_response_authentication') %>
+ChallengeResponseAuthentication <%= scope.lookupvar('::sshd::challenge_response_authentication') %>
# To disable tunneled clear text passwords, change to no here!
-PasswordAuthentication <%= scope.lookupvar('sshd::password_authentication') %>
+PasswordAuthentication <%= scope.lookupvar('::sshd::password_authentication') %>
# To change Kerberos options
#KerberosAuthentication no
@@ -81,16 +81,18 @@ PasswordAuthentication <%= scope.lookupvar('sshd::password_authentication') %>
# Kerberos TGT Passing does only work with the AFS kaserver
#KerberosTgtPassing yes
-X11Forwarding <%= scope.lookupvar('sshd::x11_forwarding') %>
+X11Forwarding <%= scope.lookupvar('::sshd::x11_forwarding') %>
X11DisplayOffset 10
KeepAlive yes
#UseLogin no
#MaxStartups 10:30:60
#Banner /etc/issue.net
+# do not reveal debian version (default is yes)
+DebianBanner no
#ReverseMappingCheck yes
-Subsystem sftp <%= (s=scope.lookupvar('sshd::sftp_subsystem')).empty? ? '/usr/lib/openssh/sftp-server' : s %>
+Subsystem sftp <%= (s=scope.lookupvar('::sshd::sftp_subsystem')).empty? ? '/usr/lib/openssh/sftp-server' : s %>
# Set this to 'yes' to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
@@ -101,28 +103,34 @@ Subsystem sftp <%= (s=scope.lookupvar('sshd::sftp_subsystem')).empty? ?
# 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'.
-UsePAM <%= scope.lookupvar('sshd::use_pam') %>
+UsePAM <%= scope.lookupvar('::sshd::use_pam') %>
HostbasedUsesNameFromPacketOnly yes
-AllowTcpForwarding <%= scope.lookupvar('sshd::tcp_forwarding') %>
+AllowTcpForwarding <%= scope.lookupvar('::sshd::tcp_forwarding') %>
-AllowAgentForwarding <%= scope.lookupvar('sshd::agent_forwarding') %>
+AllowAgentForwarding <%= scope.lookupvar('::sshd::agent_forwarding') %>
-<% unless (s=scope.lookupvar('sshd::allowed_users')).empty? -%>
+<% unless (s=scope.lookupvar('::sshd::allowed_users')).empty? -%>
AllowUsers <%= s %>
<% end -%>
-<% unless (s=scope.lookupvar('sshd::allowed_groups')).empty? -%>
+<% unless (s=scope.lookupvar('::sshd::allowed_groups')).empty? -%>
AllowGroups <%= s %>
<%- end -%>
-PrintMotd <%= scope.lookupvar('sshd::print_motd') %>
+PrintMotd <%= scope.lookupvar('::sshd::print_motd') %>
-<% if scope.lookupvar('sshd::hardened_ssl') == 'yes' -%>
+<% if scope.lookupvar('::sshd::hardened') == 'yes' -%>
+<% if (scope.function_versioncmp([scope.lookupvar('::ssh_version'),'6.5'])) >= 0 -%>
+KexAlgorithms curve25519-sha256@libssh.org
+Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes256-ctr
+MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-ripemd160-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,hmac-ripemd160,umac-128@openssh.com
+<% else -%>
Ciphers aes256-ctr
MACs hmac-sha1
<% end -%>
+<% end -%>
-<% unless (s=scope.lookupvar('sshd::tail_additional_options')).empty? -%>
+<% unless (s=scope.lookupvar('::sshd::tail_additional_options')).empty? -%>
<%= s %>
<% end -%>
diff --git a/templates/sshd_config/RedHat_xenenterprise.erb b/templates/sshd_config/XenServer_xenenterprise.erb
index 71b767a..71b767a 120000
--- a/templates/sshd_config/RedHat_xenenterprise.erb
+++ b/templates/sshd_config/XenServer_xenenterprise.erb