github.com/pwn-term/docker@v0.0.0-20210616085119-6e977cce2565/cli/docs/reference/commandline/swarm_unlock-key.md (about)

     1  ---
     2  title: "swarm unlock-key"
     3  description: "The swarm unlock-keycommand description and usage"
     4  keywords: "swarm, unlock-key"
     5  ---
     6  
     7  # swarm unlock-key
     8  
     9  ```markdown
    10  Usage:  docker swarm unlock-key [OPTIONS]
    11  
    12  Manage the unlock key
    13  
    14  Options:
    15        --help     Print usage
    16    -q, --quiet    Only display token
    17        --rotate   Rotate unlock key
    18  ```
    19  
    20  ## Description
    21  
    22  An unlock key is a secret key needed to unlock a manager after its Docker daemon
    23  restarts. These keys are only used when the autolock feature is enabled for the
    24  swarm.
    25  
    26  You can view or rotate the unlock key using `swarm unlock-key`. To view the key,
    27  run the `docker swarm unlock-key` command without any arguments:
    28  
    29  > **Note**
    30  >
    31  > This is a cluster management command, and must be executed on a swarm
    32  > manager node. To learn about managers and workers, refer to the
    33  > [Swarm mode section](https://docs.docker.com/engine/swarm/) in the
    34  > documentation.
    35  
    36  ## Examples
    37  
    38  ```bash
    39  $ docker swarm unlock-key
    40  
    41  To unlock a swarm manager after it restarts, run the `docker swarm unlock`
    42  command and provide the following key:
    43  
    44      SWMKEY-1-fySn8TY4w5lKcWcJPIpKufejh9hxx5KYwx6XZigx3Q4
    45  
    46  Please remember to store this key in a password manager, since without it you
    47  will not be able to restart the manager.
    48  ```
    49  
    50  Use the `--rotate` flag to rotate the unlock key to a new, randomly-generated
    51  key:
    52  
    53  ```bash
    54  $ docker swarm unlock-key --rotate
    55  
    56  Successfully rotated manager unlock key.
    57  
    58  To unlock a swarm manager after it restarts, run the `docker swarm unlock`
    59  command and provide the following key:
    60  
    61      SWMKEY-1-7c37Cc8654o6p38HnroywCi19pllOnGtbdZEgtKxZu8
    62  
    63  Please remember to store this key in a password manager, since without it you
    64  will not be able to restart the manager.
    65  ```
    66  
    67  The `-q` (or `--quiet`) flag only prints the key:
    68  
    69  ```bash
    70  $ docker swarm unlock-key -q
    71  
    72  SWMKEY-1-7c37Cc8654o6p38HnroywCi19pllOnGtbdZEgtKxZu8
    73  ```
    74  
    75  ### `--rotate`
    76  
    77  This flag rotates the unlock key, replacing it with a new randomly-generated
    78  key. The old unlock key will no longer be accepted.
    79  
    80  ### `--quiet`
    81  
    82  Only print the unlock key, without instructions.
    83  
    84  ## Related commands
    85  
    86  * [swarm ca](swarm_ca.md)
    87  * [swarm init](swarm_init.md)
    88  * [swarm join](swarm_join.md)
    89  * [swarm join-token](swarm_join-token.md)
    90  * [swarm leave](swarm_leave.md)
    91  * [swarm unlock](swarm_unlock.md)
    92  * [swarm update](swarm_update.md)