Saltstack Official OpenSSH Formula
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

sshd_config 3.9KB

11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. {% set sshd_config = pillar.get('sshd_config', {}) %}
  2. # This file is managed by salt. Manual changes risk being overwritten.
  3. # The contents of the original sshd_config are kept on the bottom for
  4. # quick reference.
  5. # See the sshd_config(5) manpage for details
  6. {% for keyword, argument in sshd_config.iteritems() %}
  7. {%- if argument is sameas true %}
  8. {{ keyword }} yes
  9. {%- elif argument is sameas false %}
  10. {{ keyword }} no
  11. {%- elif argument is string or argument is number %}
  12. {{ keyword }} {{ argument }}
  13. {%- else %}
  14. {%- for item in argument %}
  15. {{ keyword }} {{ item }}
  16. {%- endfor %}
  17. {%- endif %}
  18. {%- endfor %}
  19. # What ports, IPs and protocols we listen for
  20. #Port 22
  21. # Use these options to restrict which interfaces/protocols sshd will bind to
  22. #ListenAddress ::
  23. #ListenAddress 0.0.0.0
  24. #Protocol 2
  25. # HostKeys for protocol version 2
  26. #HostKey /etc/ssh/ssh_host_rsa_key
  27. #HostKey /etc/ssh/ssh_host_dsa_key
  28. #HostKey /etc/ssh/ssh_host_ecdsa_key
  29. #Privilege Separation is turned on for security
  30. #UsePrivilegeSeparation yes
  31. # Lifetime and size of ephemeral version 1 server key
  32. #KeyRegenerationInterval 3600
  33. #ServerKeyBits 768
  34. # Logging
  35. #SyslogFacility AUTH
  36. #LogLevel INFO
  37. # Authentication:
  38. #LoginGraceTime 120
  39. #PermitRootLogin yes
  40. #StrictModes yes
  41. #RSAAuthentication yes
  42. #PubkeyAuthentication yes
  43. #AuthorizedKeysFile %h/.ssh/authorized_keys
  44. # Don't read the user's ~/.rhosts and ~/.shosts files
  45. #IgnoreRhosts yes
  46. # For this to work you will also need host keys in /etc/ssh_known_hosts
  47. #RhostsRSAAuthentication no
  48. # similar for protocol version 2
  49. #HostbasedAuthentication no
  50. # Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
  51. #IgnoreUserKnownHosts yes
  52. # To enable empty passwords, change to yes (NOT RECOMMENDED)
  53. #PermitEmptyPasswords no
  54. # Change to yes to enable challenge-response passwords (beware issues with
  55. # some PAM modules and threads)
  56. #ChallengeResponseAuthentication no
  57. # Change to no to disable tunnelled clear text passwords
  58. #PasswordAuthentication yes
  59. # Kerberos options
  60. #KerberosAuthentication no
  61. #KerberosGetAFSToken no
  62. #KerberosOrLocalPasswd yes
  63. #KerberosTicketCleanup yes
  64. # GSSAPI options
  65. #GSSAPIAuthentication no
  66. #GSSAPICleanupCredentials yes
  67. #X11Forwarding yes
  68. #X11DisplayOffset 10
  69. #PrintMotd no
  70. #PrintLastLog yes
  71. #TCPKeepAlive yes
  72. #UseLogin no
  73. #MaxStartups 10:30:60
  74. #Banner /etc/issue.net
  75. # Allow client to pass locale environment variables
  76. #AcceptEnv LANG LC_*
  77. #Subsystem sftp /usr/lib/openssh/sftp-server
  78. # Set this to 'yes' to enable PAM authentication, account processing,
  79. # and session processing. If this is enabled, PAM authentication will
  80. # be allowed through the ChallengeResponseAuthentication and
  81. # PasswordAuthentication. Depending on your PAM configuration,
  82. # PAM authentication via ChallengeResponseAuthentication may bypass
  83. # the setting of "PermitRootLogin without-password".
  84. # If you just want the PAM account and session checks to run without
  85. # PAM authentication, then enable this but set PasswordAuthentication
  86. # and ChallengeResponseAuthentication to 'no'.
  87. UsePAM yes
  88. #AllowAgentForwarding yes
  89. #AllowTcpForwarding yes
  90. #GatewayPorts no
  91. X11Forwarding yes
  92. #X11DisplayOffset 10
  93. #X11UseLocalhost yes
  94. PrintMotd no # pam does that
  95. #PrintLastLog yes
  96. #TCPKeepAlive yes
  97. #UseLogin no
  98. {% if grains['os_family'] == 'RedHat' %}
  99. UsePrivilegeSeparation yes # RedHat/Centos 6.4 and earlier currently ship 5.3 (sandbox introduced in OpenSSH 5.9)
  100. {% else %}
  101. UsePrivilegeSeparation sandbox # Default for new installations.
  102. {% endif %}
  103. #PermitUserEnvironment no
  104. #Compression delayed
  105. #ClientAliveInterval 0
  106. #ClientAliveCountMax 3
  107. #UseDNS yes
  108. #PidFile /run/sshd.pid
  109. #MaxStartups 10:30:100
  110. #PermitTunnel no
  111. #ChrootDirectory none
  112. #VersionAddendum none
  113. # no default banner path
  114. Banner /etc/ssh/banner
  115. # override default of no subsystems
  116. Subsystem sftp /usr/lib/ssh/sftp-server
  117. # Example of overriding settings on a per-user basis
  118. #Match User anoncvs
  119. # X11Forwarding no
  120. # AllowTcpForwarding no
  121. # ForceCommand cvs server