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 3.2KB

11 years ago
11 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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.auth_map``
  18. -----------
  19. Same functionality as openssh.auth but with a simplified Pillar syntax.
  20. Plays nicely with `Pillarstack
  21. <https://docs.saltstack.com/en/latest/ref/pillar/all/salt.pillar.stack.html>`_.
  22. ``openssh.banner``
  23. ------------------
  24. Installs a banner that users see when SSH-ing in.
  25. ``openssh.client``
  26. ------------------
  27. Installs the openssh client package.
  28. ``openssh.config``
  29. ------------------
  30. Installs the ssh daemon configuration file included in this formula
  31. (under "openssh/files"). This configuration file is populated
  32. by values from pillar. ``pillar.example`` results in the generation
  33. of the default ``sshd_config`` file on Debian Wheezy.
  34. It is highly recommended ``PermitRootLogin`` is added to pillar
  35. so root login will be disabled.
  36. ``openssh.known_hosts``
  37. -----------------------
  38. Manages the site-wide ssh_known_hosts file and fills it with the
  39. public SSH host keys of all minions. You can restrict the set of minions
  40. whose keys are listed by using the pillar data ``openssh:known_hosts:target``
  41. and ``openssh:known_hosts:expr_form`` (those fields map directly to the
  42. corresponding attributes of the ``mine.get`` function).
  43. The Salt mine is used to share the public SSH host keys, you must thus
  44. configure it accordingly on all hosts that must export their keys. Two
  45. mine functions are required, one that exports the keys (one key per line,
  46. as they are stored in ``/etc/ssh/ssh_host_*_key.pub``) and one that defines
  47. the public hostname that the keys are associated to. Here's the way to
  48. setup those functions through pillar::
  49. # Required for openssh.known_hosts
  50. mine_functions:
  51. public_ssh_host_keys:
  52. mine_function: cmd.run
  53. cmd: cat /etc/ssh/ssh_host_*_key.pub
  54. python_shell: True
  55. public_ssh_hostname:
  56. mine_function: grains.get
  57. key: id
  58. The above example assumes that the minion identifier is a valid DNS name
  59. that can be used to connect to the host. If that's not the case, you might
  60. want to use the ``fqdn`` grain instead of the ``id`` one. The above example
  61. also uses the default mine function names used by this formula. If you have to
  62. use other names, then you should indicate the names to use in pillar keys
  63. ``openssh:known_hosts:mine_keys_function`` and
  64. ``openssh:known_hosts:mine_hostname_function``.
  65. You can also integrate alternate DNS names of the various hosts in the
  66. ssh_known_hosts files. You just have to list all the alternate DNS names as a
  67. list in the ``openssh:known_hosts:aliases`` pillar key. Whenever the IPv4 or
  68. IPv6 behind one of those DNS entries matches an IPv4 or IPv6 behind the
  69. official hostname of a minion, the alternate DNS name will be associated to the
  70. minion's public SSH host key.
  71. ``openssh.moduli``
  72. -----------------------
  73. Manages the system wide ``/etc/ssh/moduli`` file.