Debian_jessie.erb 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. # This file is managed by Puppet, all local modifications will be overwritten
  2. #
  3. # Package generated configuration file
  4. # See the sshd_config(5) manpage for details
  5. <% unless (s=scope.lookupvar('sshd::head_additional_options')).empty? -%>
  6. <%= s %>
  7. <% end -%>
  8. # What ports, IPs and protocols we listen for
  9. <% scope.lookupvar('sshd::ports').to_a.each do |port| -%>
  10. <% if port == 'off' -%>
  11. #Port -- disabled by puppet
  12. <% else -%>
  13. Port <%= port %>
  14. <% end -%>
  15. <% end -%>
  16. # Use these options to restrict which interfaces/protocols sshd will bind to
  17. <% scope.lookupvar('sshd::listen_address').to_a.each do |address| -%>
  18. ListenAddress <%= address %>
  19. <% end -%>
  20. Protocol 2
  21. # HostKeys for protocol version 2
  22. <% scope.lookupvar('sshd::hostkey_type').to_a.each do |hostkey_type| -%>
  23. HostKey /etc/ssh/ssh_host_<%=hostkey_type %>_key
  24. <% end -%>
  25. #Privilege Separation is turned on for security
  26. UsePrivilegeSeparation yes
  27. # Lifetime and size of ephemeral version 1 server key
  28. KeyRegenerationInterval 3600
  29. ServerKeyBits 1024
  30. # Logging
  31. SyslogFacility AUTH
  32. LogLevel INFO
  33. # Authentication:
  34. LoginGraceTime 120
  35. PermitRootLogin <%= scope.lookupvar('sshd::permit_root_login') %>
  36. StrictModes <%= scope.lookupvar('sshd::strict_modes') %>
  37. RSAAuthentication <%= scope.lookupvar('sshd::rsa_authentication') %>
  38. PubkeyAuthentication <%= scope.lookupvar('sshd::pubkey_authentication') %>
  39. AuthorizedKeysFile <%= scope.lookupvar('sshd::authorized_keys_file') %>
  40. # Don't read the user's ~/.rhosts and ~/.shosts files
  41. IgnoreRhosts <%= scope.lookupvar('sshd::ignore_rhosts') %>
  42. # For this to work you will also need host keys in /etc/ssh_known_hosts
  43. RhostsRSAAuthentication <%= scope.lookupvar('sshd::rhosts_rsa_authentication') %>
  44. # similar for protocol version 2
  45. HostbasedAuthentication <%= scope.lookupvar('sshd::hostbased_authentication') %>
  46. # Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
  47. #IgnoreUserKnownHosts yes
  48. # To enable empty passwords, change to yes (NOT RECOMMENDED)
  49. PermitEmptyPasswords <%= scope.lookupvar('sshd::permit_empty_passwords') %>
  50. # Change to yes to enable challenge-response passwords (beware issues with
  51. # some PAM modules and threads)
  52. ChallengeResponseAuthentication <%= scope.lookupvar('sshd::challenge_response_authentication') %>
  53. # Change to no to disable tunnelled clear text passwords
  54. PasswordAuthentication <%= scope.lookupvar('sshd::password_authentication') %>
  55. # Kerberos options
  56. KerberosAuthentication <%= scope.lookupvar('sshd::kerberos_authentication') %>
  57. #KerberosGetAFSToken no
  58. KerberosOrLocalPasswd <%= scope.lookupvar('sshd::kerberos_orlocalpasswd') %>
  59. KerberosTicketCleanup <%= scope.lookupvar('sshd::kerberos_ticketcleanup') %>
  60. # GSSAPI options
  61. GSSAPIAuthentication <%= scope.lookupvar('sshd::gssapi_authentication') %>
  62. GSSAPICleanupCredentials <%= scope.lookupvar('sshd::gssapi_cleanupcredentials') %>
  63. X11Forwarding <%= scope.lookupvar('sshd::x11_forwarding') %>
  64. X11DisplayOffset 10
  65. PrintMotd <%= scope.lookupvar('sshd::print_motd') %>
  66. PrintLastLog yes
  67. TCPKeepAlive yes
  68. #UseLogin no
  69. #MaxStartups 10:30:60
  70. #Banner /etc/issue.net
  71. # Allow client to pass locale environment variables
  72. AcceptEnv LANG LC_*
  73. Subsystem sftp <%= (s=scope.lookupvar('sshd::sftp_subsystem')).empty? ? '/usr/lib/openssh/sftp-server' : s %>
  74. # Set this to 'yes' to enable PAM authentication, account processing,
  75. # and session processing. If this is enabled, PAM authentication will
  76. # be allowed through the ChallengeResponseAuthentication and
  77. # PasswordAuthentication. Depending on your PAM configuration,
  78. # PAM authentication via ChallengeResponseAuthentication may bypass
  79. # the setting of "PermitRootLogin without-password".
  80. # If you just want the PAM account and session checks to run without
  81. # PAM authentication, then enable this but set PasswordAuthentication
  82. # and ChallengeResponseAuthentication to 'no'.
  83. UsePAM <%= scope.lookupvar('sshd::use_pam') %>
  84. AllowTcpForwarding <%= scope.lookupvar('sshd::tcp_forwarding') %>
  85. AllowAgentForwarding <%= scope.lookupvar('sshd::agent_forwarding') %>
  86. <% unless (s=scope.lookupvar('sshd::allowed_users')).empty? -%>
  87. AllowUsers <%= s %>
  88. <% end -%>
  89. <% unless (s=scope.lookupvar('sshd::allowed_groups')).empty? -%>
  90. AllowGroups <%= s %>
  91. <%- end -%>
  92. <% if scope.lookupvar('sshd::hardened') == 'yes' -%>
  93. KexAlgorithms curve25519-sha256@libssh.org
  94. Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes256-ctr
  95. 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
  96. <% end -%>
  97. <% unless (s=scope.lookupvar('sshd::tail_additional_options')).empty? -%>
  98. <%= s %>
  99. <% end -%>