github.com/AliyunContainerService/cli@v0.0.0-20181009023821-814ced4b30d0/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 <!-- This file is maintained within the docker/cli GitHub 8 repository at https://github.com/docker/cli/. Make all 9 pull requests against that repo. If you see this file in 10 another repository, consider it read-only there, as it will 11 periodically be overwritten by the definitive file. Pull 12 requests which include edits to this file in other repositories 13 will be rejected. 14 --> 15 16 # swarm unlock-key 17 18 ```markdown 19 Usage: docker swarm unlock-key [OPTIONS] 20 21 Manage the unlock key 22 23 Options: 24 --help Print usage 25 -q, --quiet Only display token 26 --rotate Rotate unlock key 27 ``` 28 29 ## Description 30 31 An unlock key is a secret key needed to unlock a manager after its Docker daemon 32 restarts. These keys are only used when the autolock feature is enabled for the 33 swarm. 34 35 You can view or rotate the unlock key using `swarm unlock-key`. To view the key, 36 run the `docker swarm unlock-key` command without any arguments: 37 38 ## Examples 39 40 ```bash 41 $ docker swarm unlock-key 42 43 To unlock a swarm manager after it restarts, run the `docker swarm unlock` 44 command and provide the following key: 45 46 SWMKEY-1-fySn8TY4w5lKcWcJPIpKufejh9hxx5KYwx6XZigx3Q4 47 48 Please remember to store this key in a password manager, since without it you 49 will not be able to restart the manager. 50 ``` 51 52 Use the `--rotate` flag to rotate the unlock key to a new, randomly-generated 53 key: 54 55 ```bash 56 $ docker swarm unlock-key --rotate 57 Successfully rotated manager unlock key. 58 59 To unlock a swarm manager after it restarts, run the `docker swarm unlock` 60 command and provide the following key: 61 62 SWMKEY-1-7c37Cc8654o6p38HnroywCi19pllOnGtbdZEgtKxZu8 63 64 Please remember to store this key in a password manager, since without it you 65 will not be able to restart the manager. 66 ``` 67 68 The `-q` (or `--quiet`) flag only prints the key: 69 70 ```bash 71 $ docker swarm unlock-key -q 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)