> For the complete documentation index, see [llms.txt](https://yubico.gitbook.io/yubikey5/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://yubico.gitbook.io/yubikey5/piv-1/getting-started/3.-cli.md).

# 3. CLI

{% hint style="info" %}
At the time of writing this, I mainly use a Windows machine. I've never used mac, and I haven't set up Yubikey to work on Linux yet. So most of these instructions will be for Windows users. I will provide resources however in order to download for other operating systems.\
\
[**For a full guide on how to install ykman, visit our official documentation here.**](/yubikey5/guides/setting-up-cli-ykman.md)

Guide includes Windows, Linux, and MacOS.
{% endhint %}

At this part of the guide, you should have learned what your PIV **PIN**, PUK, and Management Keys are. You should have also learned how to change them. If you haven't, please go back to the beginning of this guide on the ![](/files/YGAOSl32PLNnCMuZTfw4) [**INTERFACE page**](/yubikey5/piv-1/getting-started/1.-interface.md).

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

|                                                                                                                                  |
| -------------------------------------------------------------------------------------------------------------------------------- |
| ![](/files/YGAOSl32PLNnCMuZTfw4) [**Change PIV retries**](#change-retries)                                                       |
| ![](/files/YGAOSl32PLNnCMuZTfw4) [**Change PIN**](/yubikey5/piv-1/getting-started/2.-pins/change.md#pin-1)                       |
| ![](/files/YGAOSl32PLNnCMuZTfw4) [**Change PUK**](/yubikey5/piv-1/getting-started/2.-pins/change.md#puk-1)                       |
| ![](/files/YGAOSl32PLNnCMuZTfw4) [**Change Management Key**](/yubikey5/piv-1/getting-started/2.-pins/change.md#management-key-1) |
| ![](/files/YGAOSl32PLNnCMuZTfw4) [**Reset PIV Module**](/yubikey5/piv-1/getting-started/2.-pins/change.md#reset)                 |

## <mark style="color:red;">❊ What Is Ykman?</mark>

ykman is the command-line version of the Yubikey Manager which gives the user a huge list of commands that they can use on their Yubikey.&#x20;

The Yubikey Manager is a great program; however, it greatly lacks a lot of features that ykman provides.

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

In order to make the following edits; you will be using a command-line called <mark style="color:red;">**YKMAN**</mark>. This command-line tool is included with the installation of the Yubikey Manager.

It usually sits in the same folder as where you have the Yubikey Manager installed.

|                                             |                                                   |
| ------------------------------------------- | ------------------------------------------------- |
| <mark style="color:red;">**Windows**</mark> | C:\Program Files\Yubico\YubiKey Manager\ykman.exe |

If you haven't already installed the ![](/files/YGAOSl32PLNnCMuZTfw4) [**Yubikey Manager, please visit the install / download page here**](https://developers.yubico.com/yubikey-manager-qt/)**.**

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

To access and use <mark style="color:red;">**ykman**</mark>, you need to open up <mark style="color:blue;">**Command Prompt**</mark>, <mark style="color:blue;">**Terminal**</mark> or <mark style="color:blue;">**Powershell**</mark>.

Once in your desired terminal, navigate to the folder with Yubikey Manager installed:

```
cd "C:\Program Files\Yubico\YubiKey Manager"
```

{% tabs %}
{% tab title="Command Prompt" %}

```
where ykman.exe
```

{% endtab %}

{% tab title="Powershell" %}

```powershell
get-command ykman.exe
```

{% endtab %}
{% endtabs %}

Once you are in the Yubikey Manager folder, type the following to confirm you have found ykman:

```powershell
ykman.exe --version
```

After typing the above command, you should see something similar to the following print:

```powershell
PS C:\Program Files\Yubico\YubiKey Manager> ykman.exe --version

YubiKey Manager (ykman) version: 4.0.7
```

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

The <mark style="color:red;">**retries counter**</mark> is the number of times you are allowed to incorrectly type in your PIN or PUK, before the Yubikey locks you out. You may set the numbers below to whatever amount you want:

```powershell
ykman piv access set-retries 5 3
```

<table><thead><tr><th width="135">Value</th><th></th></tr></thead><tbody><tr><td><mark style="color:yellow;"><strong>5</strong></mark></td><td>Number of PIN retries</td></tr><tr><td><mark style="color:yellow;"><strong>3</strong></mark></td><td>Number of PUK retries</td></tr></tbody></table>

{% hint style="warning" %}
Changing the number of retries WILL reset your configured PIN and PUK to factory defaults.
{% endhint %}
