Back to Lego

Account Operations

docs/content/advanced/accounts.md

5.0.21.3 KB
Original Source

This section describes account operations.

<!--more-->

List Accounts

You can list all the accounts registered in your local storage:

bash
lego accounts list

Output:

Found the following accounts:
[email protected]
├── Email: 
├── Server: https://acme-v02.api.letsencrypt.org/directory
├── Key Type: EC256
└── Path: /path/to/.lego/accounts/acme-v02.api.letsencrypt.org/[email protected]/account.json

...

Register

You can register a new account by using the following command:

{{< tabs >}} {{% tab title="Simple Registration" %}}

bash
lego accounts register --account-id='myaccount'

{{% /tab %}} {{% tab title="With External Account Binding" %}}

bash
lego accounts register --account-id='myaccount' \
    --server https://example.com/ca \
    --eab \
    --eab.kid xxx \
    --eab.hmac yyy

{{% /tab %}} {{< /tabs >}}

Key Rollover

You can change the account private key (a key rollover) by using the following command:

bash
lego accounts keyrollover --account-id='myaccount'

Account Recovery

You can recover/import an account, to do that, you need the private key of the account.

bash
lego account recover --account-id='myaccount' --private-key /path/to/private-key.pem

The account will be imported and added to .lego/accounts/.