Saltstack Official OpenSSH Formula
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

213 linhas
8.2KB

  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: 1024
  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: 'no'
  39. X11DisplayOffset: 10
  40. PrintMotd: 'yes'
  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. # You can specify KexAlgorithms, Ciphers and MACs as both key or a list.
  62. # The configuration given in the example below is based on:
  63. # https://stribika.github.io/2015/01/04/secure-secure-shell.html
  64. #KexAlgorithms: 'curve25519-sha256@libssh.org,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1'
  65. #Ciphers: 'chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr'
  66. #MACs: 'hmac-sha1'
  67. KexAlgorithms:
  68. - 'curve25519-sha256@libssh.org'
  69. - 'diffie-hellman-group-exchange-sha256'
  70. - 'diffie-hellman-group-exchange-sha1'
  71. - 'diffie-hellman-group14-sha1'
  72. Ciphers:
  73. - 'chacha20-poly1305@openssh.com'
  74. - 'aes256-gcm@openssh.com'
  75. - 'aes128-gcm@openssh.com'
  76. - 'aes256-ctr'
  77. - 'aes192-ctr'
  78. - 'aes128-ctr'
  79. MACs:
  80. - 'hmac-sha1'
  81. ssh_config:
  82. StrictHostKeyChecking: no
  83. ForwardAgent: no
  84. ForwardX11: no
  85. RhostsRSAAuthentication: no
  86. RSAAuthentication: yes
  87. PasswordAuthentication: yes
  88. HostbasedAuthentication: no
  89. GSSAPIAuthentication: no
  90. GSSAPIDelegateCredentials: no
  91. BatchMode: 'yes'
  92. CheckHostIP: 'yes'
  93. AddressFamily: 'any'
  94. ConnectTimeout: 0
  95. IdentityFile: '~/.ssh/id_rsa'
  96. Port: 22
  97. Protocol: 2
  98. Cipher: '3des'
  99. Tunnel: 'no'
  100. TunnelDevice: 'any:any'
  101. PermitLocalCommand: 'no'
  102. VisualHostKey: 'no'
  103. openssh:
  104. # Controls if SSHD should be enabled/started
  105. sshd_enable: true
  106. auth:
  107. joe-valid-ssh-key-desktop:
  108. - user: joe
  109. present: True
  110. enc: ssh-rsa
  111. comment: main key - desktop
  112. source: salt://ssh_keys/joe.desktop.pub
  113. joe-valid-ssh-key-notebook:
  114. - user: joe
  115. present: True
  116. enc: ssh-rsa
  117. comment: main key - notebook
  118. source: salt://ssh_keys/joe.netbook.pub
  119. joe-non-valid-ssh-key:
  120. - user: joe
  121. present: False
  122. enc: ssh-rsa
  123. comment: obsolete key - removed
  124. source: salt://ssh_keys/joe.no-valid.pub
  125. generate_dsa_keys: False
  126. absent_dsa_keys: False
  127. provide_dsa_keys: False
  128. dsa:
  129. private_key: |
  130. -----BEGIN DSA PRIVATE KEY-----
  131. NOT_DEFINED
  132. -----END DSA PRIVATE KEY-----
  133. public_key: |
  134. ssh-dss NOT_DEFINED
  135. generate_ecdsa_keys: False
  136. absent_ecdsa_keys: False
  137. provide_ecdsa_keys: False
  138. ecdsa:
  139. private_key: |
  140. -----BEGIN EC PRIVATE KEY-----
  141. NOT_DEFINED
  142. -----END EC PRIVATE KEY-----
  143. public_key: |
  144. ecdsa-sha2-nistp256 NOT_DEFINED
  145. generate_rsa_keys: False
  146. generate_rsa_size: 4096
  147. absent_rsa_keys: False
  148. provide_rsa_keys: False
  149. rsa:
  150. private_key: |
  151. -----BEGIN RSA PRIVATE KEY-----
  152. NOT_DEFINED
  153. -----END RSA PRIVATE KEY-----
  154. public_key: |
  155. ssh-rsa NOT_DEFINED
  156. generate_ed25519_keys: False
  157. absent_ed25519_keys: False
  158. provide_ed25519_keys: False
  159. ed25519:
  160. private_key: |
  161. -----BEGIN OPENSSH PRIVATE KEY-----
  162. NOT_DEFINED
  163. -----END OPENSSH PRIVATE KEY-----
  164. public_key: |
  165. ssh-ed25519 NOT_DEFINED
  166. known_hosts:
  167. # The next 2 settings restrict the set of minions that will be added in
  168. # the generated ssh_known_hosts files (the default is to match all minions)
  169. target: '*'
  170. expr_form: 'glob'
  171. # Name of mining functions used to gather public keys and hostnames
  172. # (the default values are shown here)
  173. mine_keys_function: public_ssh_host_keys
  174. mine_hostname_function: public_ssh_hostname
  175. # List of DNS entries also pointing to our managed machines and that we want
  176. # to inject in our generated ssh_known_hosts file
  177. aliases:
  178. - cname-to-minion.example.org
  179. - alias.example.org
  180. # specify DH parameters (see /etc/ssh/moduli)
  181. moduli: |
  182. # Time Type Tests Tries Size Generator Modulus
  183. 20120821045639 2 6 100 2047 2 DD2047CBDBB6F8E919BC63DE885B34D0FD6E3DB2887D8B46FE249886ACED6B46DFCD5553168185FD376122171CD8927E60120FA8D01F01D03E58281FEA9A1ABE97631C828E41815F34FDCDF787419FE13A3137649AA93D2584230DF5F24B5C00C88B7D7DE4367693428C730376F218A53E853B0851BAB7C53C15DA7839CBE1285DB63F6FA45C1BB59FE1C5BB918F0F8459D7EF60ACFF5C0FA0F3FCAD1C5F4CE4416D4F4B36B05CDCEBE4FB879E95847EFBC6449CD190248843BC7EDB145FBFC4EDBB1A3C959298F08F3BA2CFBE231BBE204BE6F906209D28BD4820AB3E7BE96C26AE8A809ADD8D1A5A0B008E9570FA4C4697E116B8119892C604293680B09D63
  184. 20120821045830 2 6 100 2047 2 DD2047CBDBB6F8E919BC63DE885B34D0FD6E3DB2887D8B46FE249886ACED6B46DFCD5553168185FD376122171CD8927E60120FA8D01F01D03E58281FEA9A1ABE97631C828E41815F34FDCDF787419FE13A3137649AA93D2584230DF5F24B5C00C88B7D7DE4367693428C730376F218A53E853B0851BAB7C53C15DA7839CBE1285DB63F6FA45C1BB59FE1C5BB918F0F8459D7EF60ACFF5C0FA0F3FCAD1C5F4CE4416D4F4B36B05CDCEBE4FB879E95847EFBC6449CD190248843BC7EDB145FBFC4EDBB1A3C959298F08F3BA2CFBE231BBE204BE6F906209D28BD4820AB3E7BE96C26AE8A809ADD8D1A5A0B008E9570FA4C4697E116B8119892C6042936814C2FFB
  185. 20120821050046 2 6 100 2047 2 DD2047CBDBB6F8E919BC63DE885B34D0FD6E3DB2887D8B46FE249886ACED6B46DFCD5553168185FD376122171CD8927E60120FA8D01F01D03E58281FEA9A1ABE97631C828E41815F34FDCDF787419FE13A3137649AA93D2584230DF5F24B5C00C88B7D7DE4367693428C730376F218A53E853B0851BAB7C53C15DA7839CBE1285DB63F6FA45C1BB59FE1C5BB918F0F8459D7EF60ACFF5C0FA0F3FCAD1C5F4CE4416D4F4B36B05CDCEBE4FB879E95847EFBC6449CD190248843BC7EDB145FBFC4EDBB1A3C959298F08F3BA2CFBE231BBE204BE6F906209D28BD4820AB3E7BE96C26AE8A809ADD8D1A5A0B008E9570FA4C4697E116B8119892C60429368214FC53
  186. 20120821050054 2 6 100 2047 5 DD2047CBDBB6F8E919BC63DE885B34D0FD6E3DB2887D8B46FE249886ACED6B46DFCD5553168185FD376122171CD8927E60120FA8D01F01D03E58281FEA9A1ABE97631C828E41815F34FDCDF787419FE13A3137649AA93D2584230DF5F24B5C00C88B7D7DE4367693428C730376F218A53E853B0851BAB7C53C15DA7839CBE1285DB63F6FA45C1BB59FE1C5BB918F0F8459D7EF60ACFF5C0FA0F3FCAD1C5F4CE4416D4F4B36B05CDCEBE4FB879E95847EFBC6449CD190248843BC7EDB145FBFC4EDBB1A3C959298F08F3BA2CFBE231BBE204BE6F906209D28BD4820AB3E7BE96C26AE8A809ADD8D1A5A0B008E9570FA4C4697E116B8119892C60429368218E83F
  187. # ALTERNATIVELY, specify the location of the moduli file. Examples:
  188. #moduli_source: http://some.server.somewhere/salt/moduli
  189. #moduli_source: salt://files/ssh/moduli
  190. # If moduli is specified, moduli_source will be ignored.
  191. # Also, a proper hash file *must* be included in the same path. E.g.:
  192. # http://some.server.somewhere/salt/moduli.hash
  193. # salt://files/ssh/moduli.hash
  194. # These will be automatically referenced to by the ssh_moduli state.
  195. # Required for openssh.known_hosts
  196. mine_functions:
  197. public_ssh_host_keys:
  198. mine_function: cmd.run
  199. cmd: cat /etc/ssh/ssh_host_*_key.pub
  200. python_shell: True
  201. public_ssh_hostname:
  202. mine_function: grains.get
  203. key: id