salt-key.rst 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. .. _salt-key:
  2. ============
  3. ``salt-key``
  4. ============
  5. Synopsis
  6. ========
  7. .. code-block:: bash
  8. salt-key [ options ]
  9. Description
  10. ===========
  11. Salt-key executes simple management of Salt server public keys used for
  12. authentication.
  13. On initial connection, a Salt minion sends its public key to the Salt
  14. master. This key must be accepted using the ``salt-key`` command on the
  15. Salt master.
  16. Salt minion keys can be in one of the following states:
  17. - **unaccepted**: key is waiting to be accepted.
  18. - **accepted**: key was accepted and the minion can communicate with the Salt
  19. master.
  20. - **rejected**: key was rejected using the ``salt-key`` command. In
  21. this state the minion does not receive any communication from the Salt
  22. master.
  23. - **denied**: key was rejected automatically by the Salt master.
  24. This occurs when a minion has a duplicate ID, or when a minion was rebuilt or
  25. had new keys generated and the previous key was not deleted from the Salt
  26. master. In this state the minion does not receive any communication from the
  27. Salt master.
  28. To change the state of a minion key, use ``-d`` to delete the key and then
  29. accept or reject the key.
  30. Options
  31. =======
  32. .. program:: salt-key
  33. .. include:: _includes/common-options.rst
  34. .. option:: -u USER, --user=USER
  35. Specify user to run salt-key
  36. .. option:: --hard-crash
  37. Raise any original exception rather than exiting gracefully. Default is
  38. False.
  39. .. option:: -q, --quiet
  40. Suppress output
  41. .. option:: -y, --yes
  42. Answer 'Yes' to all questions presented, defaults to False
  43. .. option:: --rotate-aes-key=ROTATE_AES_KEY
  44. Setting this to False prevents the master from refreshing the key session
  45. when keys are deleted or rejected, this lowers the security of the key
  46. deletion/rejection operation. Default is True.
  47. .. include:: _includes/logging-options.rst
  48. :end-before: start-console-output
  49. .. include:: _includes/logging-options.rst
  50. :start-after: stop-console-output
  51. .. |logfile| replace:: /var/log/salt/minion
  52. .. |loglevel| replace:: ``warning``
  53. .. include:: _includes/output-options.rst
  54. Actions
  55. -------
  56. .. option:: -l ARG, --list=ARG
  57. List the public keys. The args ``pre``, ``un``, and ``unaccepted`` will
  58. list unaccepted/unsigned keys. ``acc`` or ``accepted`` will list
  59. accepted/signed keys. ``rej`` or ``rejected`` will list rejected keys.
  60. Finally, ``all`` will list all keys.
  61. .. option:: -L, --list-all
  62. List all public keys. (Deprecated: use ``--list all``)
  63. .. option:: -a ACCEPT, --accept=ACCEPT
  64. Accept the specified public key (use --include-all to match rejected keys
  65. in addition to pending keys). Globs are supported.
  66. .. option:: -A, --accept-all
  67. Accepts all pending keys.
  68. .. option:: -r REJECT, --reject=REJECT
  69. Reject the specified public key (use --include-all to match accepted keys
  70. in addition to pending keys). Globs are supported.
  71. .. option:: -R, --reject-all
  72. Rejects all pending keys.
  73. .. option:: --include-all
  74. Include non-pending keys when accepting/rejecting.
  75. .. option:: -p PRINT, --print=PRINT
  76. Print the specified public key.
  77. .. option:: -P, --print-all
  78. Print all public keys
  79. .. option:: -d DELETE, --delete=DELETE
  80. Delete the specified key. Globs are supported.
  81. .. option:: -D, --delete-all
  82. Delete all keys.
  83. .. option:: -f FINGER, --finger=FINGER
  84. Print the specified key's fingerprint.
  85. .. option:: -F, --finger-all
  86. Print all keys' fingerprints.
  87. Key Generation Options
  88. ----------------------
  89. .. option:: --gen-keys=GEN_KEYS
  90. Set a name to generate a keypair for use with salt
  91. .. option:: --gen-keys-dir=GEN_KEYS_DIR
  92. Set the directory to save the generated keypair. Only works
  93. with 'gen_keys_dir' option; default is the current directory.
  94. .. option:: --keysize=KEYSIZE
  95. Set the keysize for the generated key, only works with
  96. the '--gen-keys' option, the key size must be 2048 or
  97. higher, otherwise it will be rounded up to 2048. The
  98. default is 2048.
  99. .. option:: --gen-signature
  100. Create a signature file of the master's public-key named
  101. master_pubkey_signature. The signature can be sent to a minion in the
  102. master's auth-reply and enables the minion to verify the master's public-key
  103. cryptographically. This requires a new signing-key-pair which can be
  104. auto-created with the --auto-create parameter.
  105. .. option:: --priv=PRIV
  106. The private-key file to create a signature with
  107. .. option:: --signature-path=SIGNATURE_PATH
  108. The path where the signature file should be written
  109. .. option:: --pub=PUB
  110. The public-key file to create a signature for
  111. .. option:: --auto-create
  112. Auto-create a signing key-pair if it does not yet exist
  113. See also
  114. ========
  115. :manpage:`salt(7)`
  116. :manpage:`salt-master(1)`
  117. :manpage:`salt-minion(1)`