Debian_wheezy.erb 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. # This file is managed by Puppet, all local modifications will be overwritten
  2. #
  3. # Package generated configuration file
  4. # See the sshd(8) 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 768
  30. # Logging
  31. SyslogFacility AUTH
  32. LogLevel INFO
  33. # Authentication:
  34. LoginGraceTime 600
  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. # To disable tunneled clear text passwords, change to no here!
  54. PasswordAuthentication <%= scope.lookupvar('sshd::password_authentication') %>
  55. # Kerberos options
  56. KerberosAuthentication <%= scope.lookupvar('sshd::kerberos_authentication') %>
  57. KerberosOrLocalPasswd <%= scope.lookupvar('sshd::kerberos_orlocalpasswd') %>
  58. KerberosTicketCleanup <%= scope.lookupvar('sshd::kerberos_ticketcleanup') %>
  59. # GSSAPI options
  60. GSSAPIAuthentication <%= scope.lookupvar('sshd::gssapi_authentication') %>
  61. GSSAPICleanupCredentials <%= scope.lookupvar('sshd::gssapi_cleanupcredentials') %>
  62. X11Forwarding <%= scope.lookupvar('sshd::x11_forwarding') %>
  63. X11DisplayOffset 10
  64. PrintMotd <%= scope.lookupvar('sshd::print_motd') %>
  65. PrintLastLog yes
  66. TCPKeepAlive yes
  67. #UseLogin no
  68. #MaxStartups 10:30:60
  69. #Banner /etc/issue.net
  70. # Allow client to pass locale environment variables
  71. AcceptEnv LANG LC_*
  72. Subsystem sftp <%= (s=scope.lookupvar('sshd::sftp_subsystem')).empty? ? '/usr/lib/openssh/sftp-server' : s %>
  73. # Set this to 'yes' to enable PAM authentication, account processing,
  74. # and session processing. If this is enabled, PAM authentication will
  75. # be allowed through the ChallengeResponseAuthentication and
  76. # PasswordAuthentication. Depending on your PAM configuration,
  77. # PAM authentication via ChallengeResponseAuthentication may bypass
  78. # the setting of "PermitRootLogin without-password".
  79. # If you just want the PAM account and session checks to run without
  80. # PAM authentication, then enable this but set PasswordAuthentication
  81. # and ChallengeResponseAuthentication to 'no'.
  82. UsePAM <%= scope.lookupvar('sshd::use_pam') %>
  83. AllowTcpForwarding <%= scope.lookupvar('sshd::tcp_forwarding') %>
  84. AllowAgentForwarding <%= scope.lookupvar('sshd::agent_forwarding') %>
  85. <% unless (s=scope.lookupvar('sshd::allowed_users')).empty? -%>
  86. AllowUsers <%= s %>
  87. <% end -%>
  88. <% unless (s=scope.lookupvar('sshd::allowed_groups')).empty? -%>
  89. AllowGroups <%= s %>
  90. <%- end -%>
  91. <% if scope.lookupvar('sshd::hardened') == 'yes' -%>
  92. Ciphers aes256-ctr
  93. MACs hmac-sha1
  94. <% end -%>
  95. <% unless (s=scope.lookupvar('sshd::tail_additional_options')).empty? -%>
  96. <%= s %>
  97. <% end -%>