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.

139 lines
3.7KB

  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. LoginGraceTime: 120
  15. PermitRootLogin: 'yes'
  16. PasswordAuthentication: 'no'
  17. StrictModes: 'yes'
  18. RSAAuthentication: 'yes'
  19. PubkeyAuthentication: 'yes'
  20. IgnoreRhosts: 'yes'
  21. RhostsRSAAuthentication: 'no'
  22. HostbasedAuthentication: 'no'
  23. PermitEmptyPasswords: 'no'
  24. ChallengeResponseAuthentication: 'no'
  25. AuthenticationMethods: 'publickey,keyboard-interactive'
  26. X11Forwarding: 'yes'
  27. X11DisplayOffset: 10
  28. PrintMotd: 'no'
  29. PrintLastLog: 'yes'
  30. TCPKeepAlive: 'yes'
  31. AcceptEnv: "LANG LC_*"
  32. Subsystem: "sftp /usr/lib/openssh/sftp-server"
  33. UsePAM: 'yes'
  34. UseDNS: 'yes'
  35. AllowUsers: 'vader@10.0.0.1 maul@evil.com sidious luke'
  36. DenyUsers: 'yoda chewbaca@112.10.21.1'
  37. AllowGroups: 'wheel staff imperial'
  38. DenyGroups: 'rebel'
  39. matches:
  40. sftp_chroot:
  41. type:
  42. Group: sftpusers
  43. options:
  44. ChrootDirectory: /sftp-chroot/%u
  45. X11Forwarding: no
  46. AllowTcpForwarding: no
  47. ForceCommand: internal-sftp
  48. # Check `man sshd_config` for supported KexAlgorithms, Ciphers and MACs first.
  49. KexAlgorithms: 'diffie-hellman-group14-sha1,diffie-hellman-group1-sha1'
  50. Ciphers: 'aes128-ctr,aes256-ctr'
  51. MACs: 'hmac-sha1'
  52. openssh:
  53. auth:
  54. joe-valid-ssh-key-desktop:
  55. - user: joe
  56. present: True
  57. enc: ssh-rsa
  58. comment: main key - desktop
  59. joe-valid-ssh-key-notebook:
  60. - user: joe
  61. present: True
  62. enc: ssh-rsa
  63. comment: main key - notebook
  64. joe-non-valid-ssh-key:
  65. - user: joe
  66. present: False
  67. enc: ssh-rsa
  68. comment: obsolete key - removed
  69. generate_dsa_keys: False
  70. absent_dsa_keys: False
  71. provide_dsa_keys: False
  72. dsa:
  73. private_key: |
  74. -----BEGIN DSA PRIVATE KEY-----
  75. NOT_DEFINED
  76. -----END DSA PRIVATE KEY-----
  77. public_key: |
  78. ssh-dss NOT_DEFINED
  79. generate_ecdsa_keys: False
  80. absent_ecdsa_keys: False
  81. provide_ecdsa_keys: False
  82. ecdsa:
  83. private_key: |
  84. -----BEGIN EC PRIVATE KEY-----
  85. NOT_DEFINED
  86. -----END EC PRIVATE KEY-----
  87. public_key: |
  88. ecdsa-sha2-nistp256 NOT_DEFINED
  89. generate_rsa_keys: False
  90. absent_rsa_keys: False
  91. provide_rsa_keys: False
  92. rsa:
  93. private_key: |
  94. -----BEGIN RSA PRIVATE KEY-----
  95. NOT_DEFINED
  96. -----END RSA PRIVATE KEY-----
  97. public_key: |
  98. ssh-rsa NOT_DEFINED
  99. generate_ed25519_keys: False
  100. absent_ed25519_keys: False
  101. provide_ed25519_keys: False
  102. ed25519:
  103. private_key: |
  104. -----BEGIN OPENSSH PRIVATE KEY-----
  105. NOT_DEFINED
  106. -----END OPENSSH PRIVATE KEY-----
  107. public_key: |
  108. ssh-ed25519 NOT_DEFINED
  109. known_hosts:
  110. # The next 2 settings restrict the set of minions that will be added in
  111. # the generated ssh_known_hosts files (the default is to match all minions)
  112. target: '*'
  113. expr_form: 'glob'
  114. # Name of mining functions used to gather public keys and hostnames
  115. # (the default values are shown here)
  116. mine_keys_function: public_ssh_host_keys
  117. mine_hostname_function: public_ssh_hostname
  118. # List of DNS entries also pointing to our managed machines and that we want
  119. # to inject in our generated ssh_known_hosts file
  120. aliases:
  121. - cname-to-minion.example.org
  122. - alias.example.org
  123. # Required for openssh.known_hosts
  124. mine_functions:
  125. public_ssh_host_keys:
  126. mine_function: cmd.run
  127. cmd: cat /etc/ssh/ssh_host_*_key.pub
  128. python_shell: True
  129. public_ssh_hostname:
  130. mine_function: grains.get
  131. key: id