Gentoo.erb 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. # $OpenBSD: sshd_config,v 1.75 2007/03/19 01:01:29 djm Exp $
  2. # This is the sshd server system-wide configuration file. See
  3. # sshd_config(5) for more information.
  4. # This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin
  5. # The strategy used for options in the default sshd_config shipped with
  6. # OpenSSH is to specify options with their default value where
  7. # possible, but leave them commented. Uncommented options change a
  8. # default value.
  9. <% unless (s=scope.lookupvar('sshd::head_additional_options')).empty? -%>
  10. <%= s %>
  11. <% end -%>
  12. <% scope.lookupvar('sshd::ports').to_a.each do |port| -%>
  13. <% if port == 'off' -%>
  14. #Port -- disabled by puppet
  15. <% else -%>
  16. Port <%= port %>
  17. <% end -%>
  18. <% end -%>
  19. # Use these options to restrict which interfaces/protocols sshd will bind to
  20. <% scope.lookupvar('sshd::listen_address').to_a.each do |address| -%>
  21. ListenAddress <%= address %>
  22. <% end -%>
  23. #AddressFamily any
  24. # Disable legacy (protocol version 1) support in the server for new
  25. # installations. In future the default will change to require explicit
  26. # activation of protocol 1
  27. Protocol 2
  28. # HostKey for protocol version 1
  29. #HostKey /etc/ssh/ssh_host_key
  30. # HostKeys for protocol version 2
  31. #HostKey /etc/ssh/ssh_host_rsa_key
  32. #HostKey /etc/ssh/ssh_host_dsa_key
  33. # Lifetime and size of ephemeral version 1 server key
  34. #KeyRegenerationInterval 1h
  35. #ServerKeyBits 768
  36. # Logging
  37. # obsoletes QuietMode and FascistLogging
  38. #SyslogFacility AUTH
  39. #LogLevel INFO
  40. # Authentication:
  41. #LoginGraceTime 2m
  42. PermitRootLogin <%= scope.lookupvar('sshd::permit_root_login') %>
  43. StrictModes <%= scope.lookupvar('sshd::strict_modes') %>
  44. #MaxAuthTries 6
  45. RSAAuthentication <%= scope.lookupvar('sshd::rsa_authentication') %>
  46. PubkeyAuthentication <%= scope.lookupvar('sshd::pubkey_authentication') %>
  47. AuthorizedKeysFile <%= scope.lookupvar('sshd::authorized_keys_file') %>
  48. # For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
  49. RhostsRSAAuthentication <%= scope.lookupvar('sshd::rhosts_rsa_authentication') %>
  50. # similar for protocol version 2
  51. HostbasedAuthentication <%= scope.lookupvar('sshd::hostbased_authentication') %>
  52. # Change to yes if you don't trust ~/.ssh/known_hosts for
  53. # RhostsRSAAuthentication and HostbasedAuthentication
  54. #IgnoreUserKnownHosts no
  55. # Don't read the user's ~/.rhosts and ~/.shosts files
  56. IgnoreRhosts <%= scope.lookupvar('sshd::ignore_rhosts') %>
  57. # To disable tunneled clear text passwords, change to no here!
  58. PasswordAuthentication <%= scope.lookupvar('sshd::password_authentication') %>
  59. # To enable empty passwords, change to yes (NOT RECOMMENDED)
  60. PermitEmptyPasswords <%= scope.lookupvar('sshd::permit_empty_passwords') %>
  61. # Change to no to disable s/key passwords
  62. ChallengeResponseAuthentication <%= scope.lookupvar('sshd::challenge_response_authentication') %>
  63. # Kerberos options
  64. #KerberosAuthentication no
  65. #KerberosOrLocalPasswd yes
  66. #KerberosTicketCleanup yes
  67. #KerberosGetAFSToken no
  68. # GSSAPI options
  69. #GSSAPIAuthentication no
  70. #GSSAPICleanupCredentials yes
  71. #GSSAPIStrictAcceptorCheck yes
  72. #GSSAPIKeyExchange no
  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. #GatewayPorts no
  85. X11Forwarding <%= scope.lookupvar('sshd::x11_forwarding') %>
  86. #X11DisplayOffset 10
  87. #X11UseLocalhost yes
  88. PrintMotd <%= scope.lookupvar('sshd::print_motd') %>
  89. #PrintLastLog yes
  90. #TCPKeepAlive yes
  91. #UseLogin no
  92. #UsePrivilegeSeparation yes
  93. #PermitUserEnvironment no
  94. #Compression delayed
  95. #ClientAliveInterval 0
  96. #ClientAliveCountMax 3
  97. #UseDNS yes
  98. #PidFile /var/run/sshd.pid
  99. #MaxStartups 10
  100. #PermitTunnel no
  101. # no default banner path
  102. #Banner /some/path
  103. # override default of no subsystems
  104. Subsystem sftp <%= (s=scope.lookupvar('sshd::sftp_subsystem')).empty? ? '/usr/lib/misc/sftp-server' : s %>
  105. # Example of overriding settings on a per-user basis
  106. #Match User anoncvs
  107. # X11Forwarding no
  108. # AllowTcpForwarding no
  109. # ForceCommand cvs server
  110. <% unless (s=scope.lookupvar('sshd::allowed_users')).empty? -%>
  111. AllowUsers <%= s %>
  112. <% end -%>
  113. <% unless (s=scope.lookupvar('sshd::allowed_groups')).empty? -%>
  114. AllowGroups <%= s %>
  115. <%- end -%>
  116. <% if scope.lookupvar('sshd::hardened') == 'yes' -%>
  117. Ciphers aes256-ctr
  118. MACs hmac-sha1
  119. <% end -%>
  120. <% unless (s=scope.lookupvar('sshd::tail_additional_options')).empty? -%>
  121. <%= s %>
  122. <% end -%>