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.

191 lines
7.3KB

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