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.

201 lines
7.6KB

  1. sshd_config:
  2. # This keyword is totally optional
  3. ConfigBanner: |
  4. # Alternative banner for the config file
  5. # (Indented) hash signs lose their special meaning here
  6. # and the lines will be written as-is.
  7. Port: 22
  8. Protocol: 2
  9. HostKey:
  10. - /etc/ssh/ssh_host_rsa_key
  11. - /etc/ssh/ssh_host_dsa_key
  12. - /etc/ssh/ssh_host_ecdsa_key
  13. - /etc/ssh/ssh_host_ed25519_key
  14. UsePrivilegeSeparation: 'yes'
  15. KeyRegenerationInterval: 3600
  16. ServerKeyBits: 768
  17. SyslogFacility: AUTH
  18. LogLevel: INFO
  19. ClientAliveInterval: 0
  20. ClientAliveCountMax: 3
  21. LoginGraceTime: 120
  22. PermitRootLogin: 'yes'
  23. PasswordAuthentication: 'no'
  24. StrictModes: 'yes'
  25. MaxAuthTries: 6
  26. MaxSessions: 10
  27. RSAAuthentication: 'yes'
  28. PubkeyAuthentication: 'yes'
  29. AuthorizedKeysCommand: '/usr/bin/sss_ssh_authorizedkeys'
  30. AuthorizedKeysCommandUser: 'nobody'
  31. IgnoreRhosts: 'yes'
  32. RhostsRSAAuthentication: 'no'
  33. HostbasedAuthentication: 'no'
  34. PermitEmptyPasswords: 'no'
  35. ChallengeResponseAuthentication: 'no'
  36. AuthenticationMethods: 'publickey,keyboard-interactive'
  37. AuthorizedKeysFile: '%h/.ssh/authorized_keys'
  38. X11Forwarding: 'yes'
  39. X11DisplayOffset: 10
  40. PrintMotd: 'no'
  41. PrintLastLog: 'yes'
  42. TCPKeepAlive: 'yes'
  43. AcceptEnv: "LANG LC_*"
  44. Subsystem: "sftp /usr/lib/openssh/sftp-server"
  45. UsePAM: 'yes'
  46. UseDNS: 'yes'
  47. AllowUsers: 'vader@10.0.0.1 maul@evil.com sidious luke'
  48. DenyUsers: 'yoda chewbaca@112.10.21.1'
  49. AllowGroups: 'wheel staff imperial'
  50. DenyGroups: 'rebel'
  51. matches:
  52. sftp_chroot:
  53. type:
  54. Group: sftpusers
  55. options:
  56. ChrootDirectory: /sftp-chroot/%u
  57. X11Forwarding: no
  58. AllowTcpForwarding: no
  59. ForceCommand: internal-sftp
  60. # Check `man sshd_config` for supported KexAlgorithms, Ciphers and MACs first.
  61. # For these three keywords, the options may be specified as a list...
  62. KexAlgorithms:
  63. - diffie-hellman-group14-sha1
  64. - diffie-hellman-group1-sha1
  65. # ... or a single string.
  66. Ciphers: 'aes128-ctr,aes256-ctr'
  67. MACs: 'hmac-sha1'
  68. # Similar situation for ssh_config
  69. ssh_config:
  70. StrictHostKeyChecking: no
  71. ForwardAgent: no
  72. ForwardX11: no
  73. RhostsRSAAuthentication: no
  74. RSAAuthentication: yes
  75. PasswordAuthentication: yes
  76. HostbasedAuthentication: no
  77. GSSAPIAuthentication: no
  78. GSSAPIDelegateCredentials: no
  79. BatchMode: 'yes'
  80. CheckHostIP: 'yes'
  81. AddressFamily: 'any'
  82. ConnectTimeout: 0
  83. IdentityFile: '~/.ssh/id_rsa'
  84. Port: 22
  85. Protocol: 2
  86. Cipher: '3des'
  87. Tunnel: 'no'
  88. TunnelDevice: 'any:any'
  89. PermitLocalCommand: 'no'
  90. VisualHostKey: 'no'
  91. openssh:
  92. # Controls if SSHD should be enabled/started
  93. sshd_enable: true
  94. auth:
  95. joe-valid-ssh-key-desktop:
  96. - user: joe
  97. present: True
  98. enc: ssh-rsa
  99. comment: main key - desktop
  100. source: salt://ssh_keys/joe.desktop.pub
  101. joe-valid-ssh-key-notebook:
  102. - user: joe
  103. present: True
  104. enc: ssh-rsa
  105. comment: main key - notebook
  106. source: salt://ssh_keys/joe.netbook.pub
  107. joe-non-valid-ssh-key:
  108. - user: joe
  109. present: False
  110. enc: ssh-rsa
  111. comment: obsolete key - removed
  112. source: salt://ssh_keys/joe.no-valid.pub
  113. generate_dsa_keys: False
  114. absent_dsa_keys: False
  115. provide_dsa_keys: False
  116. dsa:
  117. private_key: |
  118. -----BEGIN DSA PRIVATE KEY-----
  119. NOT_DEFINED
  120. -----END DSA PRIVATE KEY-----
  121. public_key: |
  122. ssh-dss NOT_DEFINED
  123. generate_ecdsa_keys: False
  124. absent_ecdsa_keys: False
  125. provide_ecdsa_keys: False
  126. ecdsa:
  127. private_key: |
  128. -----BEGIN EC PRIVATE KEY-----
  129. NOT_DEFINED
  130. -----END EC PRIVATE KEY-----
  131. public_key: |
  132. ecdsa-sha2-nistp256 NOT_DEFINED
  133. generate_rsa_keys: False
  134. generate_rsa_size: 4096
  135. absent_rsa_keys: False
  136. provide_rsa_keys: False
  137. rsa:
  138. private_key: |
  139. -----BEGIN RSA PRIVATE KEY-----
  140. NOT_DEFINED
  141. -----END RSA PRIVATE KEY-----
  142. public_key: |
  143. ssh-rsa NOT_DEFINED
  144. generate_ed25519_keys: False
  145. absent_ed25519_keys: False
  146. provide_ed25519_keys: False
  147. ed25519:
  148. private_key: |
  149. -----BEGIN OPENSSH PRIVATE KEY-----
  150. NOT_DEFINED
  151. -----END OPENSSH PRIVATE KEY-----
  152. public_key: |
  153. ssh-ed25519 NOT_DEFINED
  154. known_hosts:
  155. # The next 2 settings restrict the set of minions that will be added in
  156. # the generated ssh_known_hosts files (the default is to match all minions)
  157. target: '*'
  158. expr_form: 'glob'
  159. # Name of mining functions used to gather public keys and hostnames
  160. # (the default values are shown here)
  161. mine_keys_function: public_ssh_host_keys
  162. mine_hostname_function: public_ssh_hostname
  163. # List of DNS entries also pointing to our managed machines and that we want
  164. # to inject in our generated ssh_known_hosts file
  165. aliases:
  166. - cname-to-minion.example.org
  167. - alias.example.org
  168. # specify DH parameters (see /etc/ssh/moduli)
  169. moduli: |
  170. # Time Type Tests Tries Size Generator Modulus
  171. 20120821045639 2 6 100 2047 2 DD2047CBDBB6F8E919BC63DE885B34D0FD6E3DB2887D8B46FE249886ACED6B46DFCD5553168185FD376122171CD8927E60120FA8D01F01D03E58281FEA9A1ABE97631C828E41815F34FDCDF787419FE13A3137649AA93D2584230DF5F24B5C00C88B7D7DE4367693428C730376F218A53E853B0851BAB7C53C15DA7839CBE1285DB63F6FA45C1BB59FE1C5BB918F0F8459D7EF60ACFF5C0FA0F3FCAD1C5F4CE4416D4F4B36B05CDCEBE4FB879E95847EFBC6449CD190248843BC7EDB145FBFC4EDBB1A3C959298F08F3BA2CFBE231BBE204BE6F906209D28BD4820AB3E7BE96C26AE8A809ADD8D1A5A0B008E9570FA4C4697E116B8119892C604293680B09D63
  172. 20120821045830 2 6 100 2047 2 DD2047CBDBB6F8E919BC63DE885B34D0FD6E3DB2887D8B46FE249886ACED6B46DFCD5553168185FD376122171CD8927E60120FA8D01F01D03E58281FEA9A1ABE97631C828E41815F34FDCDF787419FE13A3137649AA93D2584230DF5F24B5C00C88B7D7DE4367693428C730376F218A53E853B0851BAB7C53C15DA7839CBE1285DB63F6FA45C1BB59FE1C5BB918F0F8459D7EF60ACFF5C0FA0F3FCAD1C5F4CE4416D4F4B36B05CDCEBE4FB879E95847EFBC6449CD190248843BC7EDB145FBFC4EDBB1A3C959298F08F3BA2CFBE231BBE204BE6F906209D28BD4820AB3E7BE96C26AE8A809ADD8D1A5A0B008E9570FA4C4697E116B8119892C6042936814C2FFB
  173. 20120821050046 2 6 100 2047 2 DD2047CBDBB6F8E919BC63DE885B34D0FD6E3DB2887D8B46FE249886ACED6B46DFCD5553168185FD376122171CD8927E60120FA8D01F01D03E58281FEA9A1ABE97631C828E41815F34FDCDF787419FE13A3137649AA93D2584230DF5F24B5C00C88B7D7DE4367693428C730376F218A53E853B0851BAB7C53C15DA7839CBE1285DB63F6FA45C1BB59FE1C5BB918F0F8459D7EF60ACFF5C0FA0F3FCAD1C5F4CE4416D4F4B36B05CDCEBE4FB879E95847EFBC6449CD190248843BC7EDB145FBFC4EDBB1A3C959298F08F3BA2CFBE231BBE204BE6F906209D28BD4820AB3E7BE96C26AE8A809ADD8D1A5A0B008E9570FA4C4697E116B8119892C60429368214FC53
  174. 20120821050054 2 6 100 2047 5 DD2047CBDBB6F8E919BC63DE885B34D0FD6E3DB2887D8B46FE249886ACED6B46DFCD5553168185FD376122171CD8927E60120FA8D01F01D03E58281FEA9A1ABE97631C828E41815F34FDCDF787419FE13A3137649AA93D2584230DF5F24B5C00C88B7D7DE4367693428C730376F218A53E853B0851BAB7C53C15DA7839CBE1285DB63F6FA45C1BB59FE1C5BB918F0F8459D7EF60ACFF5C0FA0F3FCAD1C5F4CE4416D4F4B36B05CDCEBE4FB879E95847EFBC6449CD190248843BC7EDB145FBFC4EDBB1A3C959298F08F3BA2CFBE231BBE204BE6F906209D28BD4820AB3E7BE96C26AE8A809ADD8D1A5A0B008E9570FA4C4697E116B8119892C60429368218E83F
  175. # ALTERNATIVELY, specify the location of the moduli file. Examples:
  176. #moduli_source: http://some.server.somewhere/salt/moduli
  177. #moduli_source: salt://files/ssh/moduli
  178. # If moduli is specified, moduli_source will be ignored.
  179. # Also, a proper hash file *must* be included in the same path. E.g.:
  180. # http://some.server.somewhere/salt/moduli.hash
  181. # salt://files/ssh/moduli.hash
  182. # These will be automatically referenced to by the ssh_moduli state.
  183. # Required for openssh.known_hosts
  184. mine_functions:
  185. public_ssh_host_keys:
  186. mine_function: cmd.run
  187. cmd: cat /etc/ssh/ssh_host_*_key.pub
  188. python_shell: True
  189. public_ssh_hostname:
  190. mine_function: grains.get
  191. key: id