# Change

#### Select which method you want to use to change your PINs:

<table><thead><tr><th width="276"></th><th></th></tr></thead><tbody><tr><td><img src="https://4238369593-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fqj0swE9RiXnBGKcxMY3V%2Fuploads%2FteBnVNnVJAD6ydRRM0QT%2Flink%20(1).png?alt=media&#x26;token=e60aa39b-175c-4514-80fb-e75aef18aa78" alt=""> <a href="#yubikey-manager"><strong>Yubikey Manager</strong></a></td><td>Yubico's Official Software with graphical interface.</td></tr><tr><td><img src="https://4238369593-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fqj0swE9RiXnBGKcxMY3V%2Fuploads%2FteBnVNnVJAD6ydRRM0QT%2Flink%20(1).png?alt=media&#x26;token=e60aa39b-175c-4514-80fb-e75aef18aa78" alt=""> <a href="#command-line-ykman"><strong>Command-line</strong></a></td><td>Enter commands using ykman.exe.</td></tr><tr><td><img src="https://4238369593-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fqj0swE9RiXnBGKcxMY3V%2Fuploads%2FteBnVNnVJAD6ydRRM0QT%2Flink%20(1).png?alt=media&#x26;token=e60aa39b-175c-4514-80fb-e75aef18aa78" alt=""> <a href="#kleopatra"><strong>Kleopatra</strong></a></td><td>Application available on Windows and Linux.</td></tr></tbody></table>

## <mark style="color:red;">❊ Yubikey Manager</mark>

<figure><img src="https://4238369593-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fqj0swE9RiXnBGKcxMY3V%2Fuploads%2FiPJcfMACG8v27gk3n6ep%2Fbanner_chgpins_yubikeymanager.png?alt=media&#x26;token=ded1b629-ac71-4260-942d-5daa7e064567" alt=""><figcaption></figcaption></figure>

### <mark style="color:blue;">PIN</mark>

To change your PIN, open the Yubikey Manager software.&#x20;

<figure><img src="https://4238369593-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fqj0swE9RiXnBGKcxMY3V%2Fuploads%2FkpX9B8lISJRQW9xZFv6F%2Fpiv_pin_change.png?alt=media&#x26;token=ace5da7d-099e-4d9f-b754-a3288911c41a" alt=""><figcaption></figcaption></figure>

Select <mark style="color:red;">**Configure PINs**</mark>

<figure><img src="https://4238369593-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fqj0swE9RiXnBGKcxMY3V%2Fuploads%2FYfKUWQ0vxPCsezPr4G2v%2Fpiv_pin_change_2.png?alt=media&#x26;token=a2a3604a-1e43-4e11-80bc-445f052d5dcc" alt=""><figcaption></figcaption></figure>

You will see a list of buttons to manage your PIV PINs.

In order to do this, you will need to have the ![](https://4238369593-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fqj0swE9RiXnBGKcxMY3V%2Fuploads%2FteBnVNnVJAD6ydRRM0QT%2Flink%20\(1\).png?alt=media\&token=e60aa39b-175c-4514-80fb-e75aef18aa78) [**Default Pins**](https://yubico.gitbook.io/yubikey5/piv-1/getting-started/2.-pins/defaults). However, there is a nice checkbox to the right which allows you to automatically supply the **Default PIN**.

<figure><img src="https://4238369593-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fqj0swE9RiXnBGKcxMY3V%2Fuploads%2FTDViksQXYu0TRFZ74uQM%2Fpiv_pin_change_3.png?alt=media&#x26;token=55800378-c64b-4f48-a93d-7a9b024f46b3" alt=""><figcaption></figcaption></figure>

<mark style="color:yellow;">Your new PIN should be between 6 - 8 characters long.</mark>

Once you have typed a new PIN, click ![](https://4238369593-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fqj0swE9RiXnBGKcxMY3V%2Fuploads%2Fafz1jRx8NdMDKm5zRB0p%2Fpiv_btn_chgpin.png?alt=media\&token=2e87fbcd-069a-4ee5-9961-8ab51c78e7c7)

### <mark style="color:blue;">PUK</mark>

Changing the **PUK** is similar to changing the PIN. Click the box to the right marked **Use Default** and then supply your new PUK.

### <mark style="color:blue;">MANAGEMENT KEY</mark>

To change your Management key, return to the PIV home screen, and select ![](https://4238369593-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fqj0swE9RiXnBGKcxMY3V%2Fuploads%2Fx22kTyLtHnZa8iVilRXl%2Fpiv_btn_chgmanagement.png?alt=media\&token=a222c6fc-19f2-4ac9-812b-4e5746842e43)

<figure><img src="https://4238369593-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fqj0swE9RiXnBGKcxMY3V%2Fuploads%2FPgmrQ7sfagXUqWR8ElyM%2Fpiv_pin_change_4.png?alt=media&#x26;token=3c77b683-53f7-4c0f-8a4d-485bbf8a1845" alt=""><figcaption></figcaption></figure>

Changing your management key is slightly different. You will first enter your current or default management key in **Current Management Key** field. (Or you can click **Use Default** on the right).

Next, you will need to provide a new management key.

On the right side, select the **Algorithm** to use for this management key. If you're unsure, just select <mark style="color:red;">**TDES**</mark>**.**&#x20;

*AES256 is supported ONLY if your Yubikey is running v5.4.x firmware or newer*.

{% hint style="info" %}
*You can check the firmware version for your Yubikey by going to the home screen of the Yubikey Manager and looking in the top left.*
{% endhint %}

Finally, click the <mark style="color:red;">**Generate**</mark> button.

Once your new key has been generated, it's recommended that you write this new Management Key down. If you generate new PIV certificates later, you will need this.

You may also select the option <mark style="color:red;">**Protect With Pin**</mark> which will allow you to use a PIN instead of typing the Management Key.

If you forget your PIN, PUK, or Management Key; you will need to **Reset** your entire PIV module and configure everything again. The reset button is located on the PIV home screen by clicking:

<figure><img src="https://4238369593-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fqj0swE9RiXnBGKcxMY3V%2Fuploads%2FxfZotkxSYfMwF3cRDLIY%2Fanim_piv.gif?alt=media&#x26;token=645b71fd-e07f-4b8d-a6c9-3c73c075ab4d" alt=""><figcaption></figcaption></figure>

{% hint style="danger" %}
Resetting your PIV module will erase everything stored in your PIV slots. All PINs will be reset and all PIV certificates will be wiped.
{% endhint %}

## <mark style="color:red;">❊ Command-Line (ykman)</mark>

<figure><img src="https://4238369593-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fqj0swE9RiXnBGKcxMY3V%2Fuploads%2FpChZnLJRdiiMG2VmOI7Q%2Fbanner_chgpins_commandline.png?alt=media&#x26;token=9763d002-cfa6-41f4-b73e-f912f95764ab" alt=""><figcaption></figcaption></figure>

If you wish to change your PIN, PUK, or Management Key using the ykman command-line, do the following:

### <mark style="color:blue;">PIN</mark>

To change your PIN, execute:\
If you do not specify <mark style="color:red;">**`-n`**</mark> or <mark style="color:red;">**-p**</mark> in your command, you will be prompted to enter each one.

```
ykman piv access change-pin
```

| Command                                 | Description                 |
| --------------------------------------- | --------------------------- |
| <mark style="color:red;">-h</mark>      | Show this message and exit. |
| <mark style="color:red;">-n TEXT</mark> | A new PIN.                  |
| <mark style="color:red;">-p TEXT</mark> | Current PIN code.           |

### <mark style="color:blue;">PUK</mark>

To change your PUK, execute:

If you do not specify <mark style="color:red;">**`-n`**</mark> or <mark style="color:red;">**-p**</mark> in your command, you will be prompted to enter each one.

```
ykman piv access change-puk
```

| Command                                 | Description                 |
| --------------------------------------- | --------------------------- |
| <mark style="color:red;">-h</mark>      | Show this message and exit. |
| <mark style="color:red;">-n TEXT</mark> | A new PUK code.             |
| <mark style="color:red;">-p TEXT</mark> | Current PUK code.           |

### <mark style="color:blue;">MANAGEMENT KEY</mark>

To change your Management key, select the tab below for what you wish to do. You can either have the Yubikey generate a new management key, or you can specify your own:

{% tabs %}
{% tab title="Generate New" %}

```
ykman piv access change-management-key -g -p
```

{% endtab %}

{% tab title="Specify" %}

```
ykman piv access change-management-key -pt -a TDES -n 9892b8f8e1c46e5598679800dcdab1e4812d5a56af27fa250965d57ec32b8abb
```

{% endtab %}
{% endtabs %}

| Command                                                                                        | Description                                                                                                                                                                                     |        |                           |                                                                      |
| ---------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | ------------------------- | -------------------------------------------------------------------- |
| <p><mark style="color:red;"><code>-a</code></mark></p><p><mark style="color:red;"><code>\[TDES | AES128                                                                                                                                                                                          | AES192 | AES256]</code></mark></p> | <p>Management key algorithm.</p><p>\[Default: <code>TDES</code>]</p> |
| <mark style="color:red;">-f</mark>                                                             | Confirm the action without prompting.                                                                                                                                                           |        |                           |                                                                      |
| <mark style="color:red;">-g</mark>                                                             | <p>Generate a random management key.</p><p>Implied by <code>--protect</code> unless<code>--new-management-key</code> is also given.</p><p>Conflicts with <code>--new-management-key</code>.</p> |        |                           |                                                                      |
| <mark style="color:red;">-m TEXT</mark>                                                        | Current management key.                                                                                                                                                                         |        |                           |                                                                      |
| <mark style="color:red;">-n TEXT</mark>                                                        | A new management key.                                                                                                                                                                           |        |                           |                                                                      |
| <mark style="color:red;">-p</mark>                                                             | Store new management key on the YubiKey, protected by PIN. A random key is used if no key is provided.                                                                                          |        |                           |                                                                      |
| <mark style="color:red;">-P TEXT</mark>                                                        | PIN code.                                                                                                                                                                                       |        |                           |                                                                      |
| <mark style="color:red;">-t</mark>                                                             | Require touch on YubiKey when prompted for management key.                                                                                                                                      |        |                           |                                                                      |

### <mark style="color:blue;">RESET</mark>

This will completely RESET your PIV module. Your PIN, PUK, and Management Keys will all be set back to ![](https://4238369593-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fqj0swE9RiXnBGKcxMY3V%2Fuploads%2FteBnVNnVJAD6ydRRM0QT%2Flink%20\(1\).png?alt=media\&token=e60aa39b-175c-4514-80fb-e75aef18aa78) [**default**](https://yubico.gitbook.io/yubikey5/piv-1/getting-started/2.-pins/defaults).

ALL PIV certificates you've installed will be wiped.

```powershell
ykman piv reset
```

| Command                            | Description                           |
| ---------------------------------- | ------------------------------------- |
| <mark style="color:red;">-h</mark> | Show this message and exit.           |
| <mark style="color:red;">-f</mark> | Confirm the action without prompting. |

## <mark style="color:red;">❊ Kleopatra</mark>

<figure><img src="https://4238369593-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fqj0swE9RiXnBGKcxMY3V%2Fuploads%2FOPgsXDJiQe7GTPGn0l0p%2Fbanner_chgpins_kleopatra.png?alt=media&#x26;token=e6681fa0-fa7f-4ec8-8d2a-cd0d21f501b5" alt=""><figcaption></figcaption></figure>

Ensure you have the Gpg tools installed on your system. Click ![](https://4238369593-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fqj0swE9RiXnBGKcxMY3V%2Fuploads%2FAXecjdsVNIpY9sLQKz6m%2Fwindows_10x_icon.png?alt=media\&token=ff2dea74-fd36-4041-be27-013ecac09af9) and search for <mark style="color:red;">**Kleopatra**</mark>**.**

<figure><img src="https://4238369593-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fqj0swE9RiXnBGKcxMY3V%2Fuploads%2F8cBibMu2ttNAFUDmWasP%2Fgpg_kleo_1.png?alt=media&#x26;token=a04f8623-d93d-460f-9f69-7ff9f08e3feb" alt=""><figcaption></figcaption></figure>

Once the application loads, locate the <mark style="color:red;">**Smartcards**</mark> button to the right side.

<figure><img src="https://4238369593-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fqj0swE9RiXnBGKcxMY3V%2Fuploads%2FXL5gzT9UpXkbwY4BJlmL%2Fgpg_kleo_2.png?alt=media&#x26;token=99b3e8c0-769f-4ae3-8d48-4400707ea992" alt=""><figcaption></figcaption></figure>

Locate the Smartcard Management section and select <mark style="color:red;">**PIV**</mark>.

<figure><img src="https://4238369593-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fqj0swE9RiXnBGKcxMY3V%2Fuploads%2FK1VhSzjRzO3EhaNYCm2u%2Fgpg_kleo_3.png?alt=media&#x26;token=05a0bbcc-7bcb-4b0c-85f5-df844995bf03" alt=""><figcaption></figcaption></figure>

In the lower portion of the PIV panel, locate the **Actions** menu.

<figure><img src="https://4238369593-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fqj0swE9RiXnBGKcxMY3V%2Fuploads%2F4VV0QxpB0mjlRzZwT1ZF%2Fgpg_kleo_4.png?alt=media&#x26;token=d0ba7ca1-142b-4bc5-8d0b-1def973d3c98" alt=""><figcaption></figcaption></figure>

### <mark style="color:blue;">PIN</mark>

The following instructions explain how to change the PIV interface's PIN.

Select ![](https://4238369593-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fqj0swE9RiXnBGKcxMY3V%2Fuploads%2FMWW28Nhs1HOh1P8nIKeg%2Fgpg_kleo_5.png?alt=media\&token=09ebd7e9-a416-4d5f-ae39-e1295c2efaad)

<figure><img src="https://4238369593-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fqj0swE9RiXnBGKcxMY3V%2Fuploads%2FhtEmnKLnqnhpvahlaA4v%2Fpiv_pin_6.png?alt=media&#x26;token=a3547f16-fa40-4359-9e53-10450943c45d" alt=""><figcaption></figcaption></figure>

This dialog is where you enter your CURRENT PIV PIN.\ <mark style="color:red;">**`default:`**</mark><mark style="color:red;">**&#x20;**</mark><mark style="color:red;">**123456**</mark>

<div><figure><img src="https://4238369593-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fqj0swE9RiXnBGKcxMY3V%2Fuploads%2F6RLLyWEeraI264Y4Y931%2Fpiv_pin_7.png?alt=media&#x26;token=55d44dd1-0155-4660-b9f2-bce770bc7274" alt=""><figcaption></figcaption></figure> <figure><img src="https://4238369593-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fqj0swE9RiXnBGKcxMY3V%2Fuploads%2FpBHYqxqn4eydfH9Ji9b6%2Fpiv_pin_8.png?alt=media&#x26;token=0567d31a-1c99-4db2-a4b4-65bec5688081" alt=""><figcaption></figcaption></figure></div>

You will then be asked to enter a NEW PIV PIN and then confirm it.

<figure><img src="https://4238369593-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fqj0swE9RiXnBGKcxMY3V%2Fuploads%2FDGeMP3u8KULWcQUFKNwj%2Fpiv_pin_9.png?alt=media&#x26;token=19e0b3e0-d1e4-49f0-8010-52175c49b031" alt=""><figcaption></figcaption></figure>

Your new PIV PIN is now saved.

### <mark style="color:blue;">PUK</mark>

These instructions explain how to change the PIV interface's PUK PIN.

Select ![](https://4238369593-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fqj0swE9RiXnBGKcxMY3V%2Fuploads%2FSGImI2xJezDmVFKBHC7T%2Fpiv_pin_4.png?alt=media\&token=dded5fb7-017a-4e84-b6c4-f290078fae0b)

<figure><img src="https://4238369593-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fqj0swE9RiXnBGKcxMY3V%2Fuploads%2F8PrQz5rzONdWFz2svcBD%2Fpiv_pin_10.png?alt=media&#x26;token=1bccca52-df79-4611-a0ad-7189d7acda87" alt=""><figcaption></figcaption></figure>

This dialog is where you enter your CURRENT PIV PUK PIN.\ <mark style="color:red;">**`default:`**</mark><mark style="color:red;">**&#x20;**</mark><mark style="color:red;">**12345678**</mark>

<div><figure><img src="https://4238369593-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fqj0swE9RiXnBGKcxMY3V%2Fuploads%2Fum8qQ0GS57jevhTWH8AU%2Fpiv_pin_11.png?alt=media&#x26;token=348ca87e-c366-4419-8f06-9d2385cd9d6a" alt=""><figcaption></figcaption></figure> <figure><img src="https://4238369593-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fqj0swE9RiXnBGKcxMY3V%2Fuploads%2FZz9lLIRxZL0txUCWCfe5%2Fpiv_pin_12.png?alt=media&#x26;token=942dce36-cc37-4f63-baaa-a5bbed66968d" alt=""><figcaption></figcaption></figure></div>

You will then be asked to enter a NEW PIV PUK PIN and then confirm it.

<figure><img src="https://4238369593-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fqj0swE9RiXnBGKcxMY3V%2Fuploads%2FccpGwKBfpaWVSqExGDbN%2Fpiv_pin_13.png?alt=media&#x26;token=eb80a0fd-2a9b-43c3-b5f3-7c47d3b83636" alt=""><figcaption></figcaption></figure>

Your new PIV PUK PIN is now saved.

### <mark style="color:blue;">MANAGEMENT KEY</mark>

These instructions allow you to change your PIV Management Key.

{% hint style="info" %}
Changing your management key with Kleopatra appears to be buggy. Sometimes throwing errors that the program cannot read the card. Recommended to use the Yubikey Manager or command-line.
{% endhint %}

Select ![](https://4238369593-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fqj0swE9RiXnBGKcxMY3V%2Fuploads%2FEWjTlkO8fHhASRAwy2i1%2Fpiv_pin_14.png?alt=media\&token=3785f184-01ae-48ed-aed9-74a027c0b591)

<figure><img src="https://4238369593-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fqj0swE9RiXnBGKcxMY3V%2Fuploads%2FMwxEgYlR74BltoGnEBBi%2Fpiv_pin_15.png?alt=media&#x26;token=907d64af-f834-473d-950d-7ba1ea716fb2" alt=""><figcaption></figcaption></figure>

This dialog is where you enter your CURRENT Management Key.\ <mark style="color:red;">**`default: 010203040506070801020304050607080102030405060708`**</mark>

<figure><img src="https://4238369593-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fqj0swE9RiXnBGKcxMY3V%2Fuploads%2FP5VBQuk7KbuyX51zE0U5%2Fpiv_pin_16.png?alt=media&#x26;token=cc758545-7c77-4d01-8a40-3ac0f35bae42" alt=""><figcaption></figcaption></figure>

You will then be asked to enter a NEW PIV Management key and then confirm it.
