YubiKey Mode Switch

The YubiKey can be mode-switched from the U2F-only mode using libu2f-host by sending some non-standardized commands.

echo -e '\x06\x00\x00\x00' | u2f-host -d -a sendrecv -c c0

The \x06 corresponds to mode 6 and the following modes are known:

  • 0 OTP device only.

  • 1 CCID device only.

  • 2 OTP/CCID composite device.

  • 3 U2F device only.

  • 4 OTP/U2F composite device.

  • 5 U2F/CCID composite device.

  • 6 OTP/U2F/CCID composite device.

Add 80 to set MODE_FLAG_EJECT, for example: 81 is mode 1 (CCID-only) with MODE_FLAG_EJECT. To select another mode, replace \x06 with what you wish. For example, if you want to put the YubiKey into pure OTP-mode use the following:

echo -e '\x01\x00\x00\x00' | u2f-host -d -a sendrecv -c c0

For mode-switching in other modes (OTP, CCID or combo modes), we recommend the following libraries and command-line tools instead:

For OTP-modes

YubiKey Personalization

For CCID-modes

YubiKey NEO CCID Manager C Library

If you prefer a GUI (for all modes)

YubiKey NEO Manager