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.

README.rst 2.7KB

11 years ago
11 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. openssh
  2. =======
  3. Install and configure an openssh server.
  4. .. note::
  5. See the full `Salt Formulas installation and usage instructions
  6. <http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html>`_.
  7. Available states
  8. ================
  9. .. contents::
  10. :local:
  11. ``openssh``
  12. -----------
  13. Installs the ``openssh`` server package and service.
  14. ``openssh.auth``
  15. -----------
  16. Manages SSH certificates for users.
  17. ``openssh.banner``
  18. ------------------
  19. Installs a banner that users see when SSH-ing in.
  20. ``openssh.client``
  21. ------------------
  22. Installs the openssh client package.
  23. ``openssh.config``
  24. ------------------
  25. Installs the ssh daemon configuration file included in this formula
  26. (under "openssh/files"). This configuration file is populated
  27. by values from pillar. ``pillar.example`` results in the generation
  28. of the default ``sshd_config`` file on Debian Wheezy.
  29. ``openssh.known_hosts``
  30. -----------------------
  31. Manages the site-wide ssh_known_hosts file and fills it with the
  32. public SSH host keys of all minions. You can restrict the set of minions
  33. whose keys are listed by using the pillar data ``openssh:known_hosts:target``
  34. and ``openssh:known_hosts:expr_form`` (those fields map directly to the
  35. corresponding attributes of the ``mine.get`` function).
  36. The Salt mine is used to share the public SSH host keys, you must thus
  37. configure it accordingly on all hosts that must export their keys. Two
  38. mine functions are required, one that exports the keys (one key per line,
  39. as they are stored in ``/etc/ssh/ssh_host_*_key.pub``) and one that defines
  40. the public hostname that the keys are associated to. Here's the way to
  41. setup those functions through pillar::
  42. # Required for openssh.known_hosts
  43. mine_functions:
  44. public_ssh_host_keys:
  45. mine_function: cmd.run
  46. cmd: cat /etc/ssh/ssh_host_*_key.pub
  47. public_ssh_hostname:
  48. mine_function: grains.get
  49. key: id
  50. The above example assumes that the minion identifier is a valid DNS name
  51. that can be used to connect to the host. If that's not the case, you might
  52. want to use the ``fqdn`` grain instead of the ``id`` one. The above example
  53. also uses the default mine function names used by this formula. If you have to
  54. use other names, then you should indicate the names to use in pillar keys
  55. ``openssh:known_hosts:mine_keys_function`` and
  56. ``openssh:known_hosts:mine_hostname_function``.
  57. You can also integrate alternate DNS names of the various hosts in the
  58. ssh_known_hosts files. You just have to list all the alternate DNS names as a
  59. list in the ``openssh:known_hosts:aliases`` pillar key. Whenever the IPv4 or
  60. IPv6 behind one of those DNS entries matches an IPv4 or IPv6 behind the
  61. official hostname of a minion, the alternate DNS name will be associated to the
  62. minion's public SSH host key.