Using the YubiKey Manager CLI

ykman can be used to configure all aspects of the YubiKey. This manual covers the options for each command as well as examples.

Windows

Run the commands from Command Prompt.

Directory

If your environment variable is not set to automatically find YubiKey Manager or ykman, change directory to the location of the ykman executables. For example, with Windows 64-bit version of YubiKey Manager installed, C:\\cd "C:\Program Files\Yubico\YubiKey Manager\".

Launch ykman

Launch ykman in GUI mode or CLI mode from the command line.

  • Launch YubiKey Manager CLI, (32-bit)

    C:\\“C:\Program Files (x86)\Yubico\YubiKey Manager\ykman.exe”

  • Launch YubiKey Manager CLI, (64-bit)

    C:\\“C:\Program Files\Yubico\YubiKey Manager\ykman.exe”

  • Launch YubiKey Manager GUI, (32-bit)

    C:\\“C:\Program Files (x86)\Yubico\YubiKey Manager\ykman-gui.exe”

  • Launch YubiKey Manager GUI, (64-bit)

    C:\\“C:\Program Files\Yubico\YubiKey Manager\ykman-gui.exe”

Launch YubiKey Manager with debug logging enabled. Add the following to the execution command.

--log-level DEBUG --log-file %USERPROFILE%\Desktop\ykman-log.txt

User Accounts

Check whether user accounts are local or Microsoft accounts.

C://Get-LocalUser | Where-Object { $_.Enabled -match "True"} | Select-Object Name,PrincipalSource,SID

macOS

From your Mac’s Terminal application, run the listed commands as needed.

Directory

Change directory to the location of the ykman executables:

% cd "/Applications/YubiKey Manager.app/Contents/MacOS/"

Run YubiKey Manager

Launch ykman in GUI mode or CLI mode from the command line.

  • Run YubiKey Manager CLI

    % /Applications/YubiKey Manager.app/Contents/MacOS/ykman

  • Run YubiKey Manager GUI

    % /Applications/YubiKey Manager.app/Contents/MacOS/ykman-gui

Run ykman with debug logging (to a file) enabled. Add the following to the run command:

--log-level DEBUG --log-file ~/Desktop/ykman.txt

Sleep Mode

Terminal Commands to eliminate the power drain issue when a YubiKey is plugged in to a sleeping Mac:

% sudo pmset -a hibernatemode 25
% sudo pmset -a standbydelay 15

Error message (bash) if macOS Logon Tool is not installed
% -bash: ykpamcfg: command not found

Mac Logon Tool

To install Mac Logon Tool through a terminal:

% cd ~/Downloads
% curl -O https://developers.yubico.com/yubico-pam/Releases/pam_yubico-2.26.pkg
% sudo installer -pkg pam_yubico-2.26.pkg -target / -verboseR

To get in touch with Yubico Support, click here.