Debian_squeeze.erb 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  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. HostKey /etc/ssh/ssh_host_rsa_key
  23. HostKey /etc/ssh/ssh_host_dsa_key
  24. #Privilege Separation is turned on for security
  25. UsePrivilegeSeparation yes
  26. # Lifetime and size of ephemeral version 1 server key
  27. KeyRegenerationInterval 3600
  28. ServerKeyBits 768
  29. # Logging
  30. SyslogFacility AUTH
  31. LogLevel INFO
  32. # Authentication:
  33. LoginGraceTime 120
  34. PermitRootLogin <%= scope.lookupvar('sshd::permit_root_login') %>
  35. StrictModes <%= scope.lookupvar('sshd::strict_modes') %>
  36. RSAAuthentication <%= scope.lookupvar('sshd::rsa_authentication') %>
  37. PubkeyAuthentication <%= scope.lookupvar('sshd::pubkey_authentication') %>
  38. AuthorizedKeysFile <%= scope.lookupvar('sshd::authorized_keys_file') %>
  39. # Don't read the user's ~/.rhosts and ~/.shosts files
  40. IgnoreRhosts <%= scope.lookupvar('sshd::ignore_rhosts') %>
  41. # For this to work you will also need host keys in /etc/ssh_known_hosts
  42. RhostsRSAAuthentication <%= scope.lookupvar('sshd::rhosts_rsa_authentication') %>
  43. # similar for protocol version 2
  44. HostbasedAuthentication <%= scope.lookupvar('sshd::hostbased_authentication') %>
  45. # Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
  46. #IgnoreUserKnownHosts yes
  47. # To enable empty passwords, change to yes (NOT RECOMMENDED)
  48. PermitEmptyPasswords <%= scope.lookupvar('sshd::permit_empty_passwords') %>
  49. # Change to yes to enable challenge-response passwords (beware issues with
  50. # some PAM modules and threads)
  51. ChallengeResponseAuthentication <%= scope.lookupvar('sshd::challenge_response_authentication') %>
  52. # To disable tunneled clear text passwords, change to no here!
  53. PasswordAuthentication <%= scope.lookupvar('sshd::password_authentication') %>
  54. # Kerberos options
  55. KerberosAuthentication <%= scope.lookupvar('sshd::kerberos_authentication') %>
  56. KerberosOrLocalPasswd <%= scope.lookupvar('sshd::kerberos_orlocalpasswd') %>
  57. KerberosTicketCleanup <%= scope.lookupvar('sshd::kerberos_ticketcleanup') %>
  58. # GSSAPI options
  59. GSSAPIAuthentication <%= scope.lookupvar('sshd::gssapi_authentication') %>
  60. GSSAPICleanupCredentials <%= scope.lookupvar('sshd::gssapi_cleanupcredentials') %>
  61. X11Forwarding <%= scope.lookupvar('sshd::x11_forwarding') %>
  62. X11DisplayOffset 10
  63. PrintMotd <%= scope.lookupvar('sshd::print_motd') %>
  64. PrintLastLog yes
  65. TCPKeepAlive yes
  66. #UseLogin no
  67. #MaxStartups 10:30:60
  68. #Banner /etc/issue.net
  69. # Allow client to pass locale environment variables
  70. AcceptEnv LANG LC_*
  71. Subsystem sftp <%= (s=scope.lookupvar('sshd::sftp_subsystem')).empty? ? '/usr/lib/openssh/sftp-server' : s %>
  72. # Set this to 'yes' to enable PAM authentication, account processing,
  73. # and session processing. If this is enabled, PAM authentication will
  74. # be allowed through the ChallengeResponseAuthentication and
  75. # PasswordAuthentication. Depending on your PAM configuration,
  76. # PAM authentication via ChallengeResponseAuthentication may bypass
  77. # the setting of "PermitRootLogin without-password".
  78. # If you just want the PAM account and session checks to run without
  79. # PAM authentication, then enable this but set PasswordAuthentication
  80. # and ChallengeResponseAuthentication to 'no'.
  81. UsePAM <%= scope.lookupvar('sshd::use_pam') %>
  82. AllowTcpForwarding <%= scope.lookupvar('sshd::tcp_forwarding') %>
  83. AllowAgentForwarding <%= scope.lookupvar('sshd::agent_forwarding') %>
  84. <% unless (s=scope.lookupvar('sshd::allowed_users')).empty? -%>
  85. AllowUsers <%= s %>
  86. <% end -%>
  87. <% unless (s=scope.lookupvar('sshd::allowed_groups')).empty? -%>
  88. AllowGroups <%= s %>
  89. <%- end -%>
  90. <% if scope.lookupvar('sshd::hardened_ssl') == 'yes' -%>
  91. Ciphers aes256-ctr
  92. MACs hmac-sha1
  93. <% end -%>
  94. <% unless (s=scope.lookupvar('sshd::tail_additional_options')).empty? -%>
  95. <%= s %>
  96. <% end -%>