Differences between revisions 3 and 4
Revision 3 as of 2016-02-25 21:33:52
Size: 2922
Editor: LucaCapello
Comment: add udev section
Revision 4 as of 2016-02-25 22:09:16
Size: 3544
Editor: LucaCapello
Comment: [OpenPGP] add Linksand Needed packages sections, plus more usage details
Deletions are marked like this. Additions are marked like this.
Line 51: Line 51:
To access the card you need [[https://packages.debian.org/gnupg|GnuPG]] and [[https://packages.debian.org/gnupg-agent|GnuPG Agent]], the version in wheezy are fine for signing/encrypting.
== Links ==

Various interesting !HowTo, especially useful if you are new to [[Subkeys|OpenPGP subkeys]]:

 * [[https://blog.josefsson.org/2014/06/23/offline-gnupg-master-key-and-subkeys-on-yubikey-neo-smartcard/]]
 * [[https://www.sidorenko.io/blog/2014/11/04/yubikey-slash-openpgp-smartcards-for-newbies/]]
 * [[https://anarc.at/blog/2015-12-14-yubikey-howto/]]
 * [[https://iain.learmonth.me/yubikey-neo-gpg/]]
Line 54: Line 62:
If you want to use 4096-bits RSA keys, you need [[https://packages.debian.org/gnupg2|GnuPG 2.x]], with the corresponding gpg-agent and scdaemon, at least the version in wheezy-backports, i.e. 2.0.25-1~bpo70+1. == Needed packages ==

To access the card you need [[https://packages.debian.org/gnupg|GnuPG]], the version in wheezy is fine for signing/encrypting.

However, i
f you want to use 4096-bits RSA keys, you need [[https://packages.debian.org/gnupg2|GnuPG 2.x]], with the corresponding gpg-agent and scdaemon, at least the version in wheezy-backports, ''i.e.'' 2.0.25-1~bpo70+1.
Line 59: Line 71:
This works out-of-the box on wheezy when [[https://packages.debian.org/gnupg-agent|GnuPG Agent]] is acting also as an SSH agent (option '''enable-ssh-support''' in ''~/.gnupg/gpg-agent.conf''). This works out-of-the box on wheezy with [[https://packages.debian.org/gnupg-agent|GnuPG Agent]] and the corresponding scdaemon. You need to configure:
Line 61: Line 73:
Once the key has been plugged in, you can check if its authentication key has been added to the SSH agent via the ''ssh-add -L'' command.  * GnuPG to use the agent, in ''~/.gnupg/gpg.conf''
{{{
use-agent
}}}

 * GnuPG Agent to also act as an SSH agent, in ''~/.gnupg/gpg-agent.conf'':
{{{
enable-ssh-support
}}}

Once the agent started and the key plugged in, you can check if its authentication key has been added to the agent via the '''ssh-add -l''' command and then export the public key via the '''ssh-add -L''' command.

The YubiKey 4 is a multi-purpose USB key produced by Yubico.

It can be used for 2-factor authentication (OTP, U2F, OATH and static password) and as a CCID smartcard (both PIV and OpenPGP), visit the Yubico product page for a full list of features and a comparison with previous versions.

udev

Up to jessie, to use the card as a non-root users, you need to add a line to /etc/udev/rules.d/99-yubikeys.rules to the tell udev either

  • to give permissions to the plugdev group

SUBSYSTEMS=="usb", ATTRS{idVendor}=="1050", ATTRS{idProduct}=="0407", GROUP="plugdev"

SUBSYSTEMS=="usb", ATTRS{idVendor}=="1050", ATTRS{idProduct}=="0407", TAG+="uaccess"

Configuration

Yubico develops various software to access the key, among them:

OTP

The key does not have a battery, so for TOTP you need an external tools:

  • yubikey-totp to generate a TOTP code from a secret stored on the key.

    • you need at least the version in stretch, i.e. 1.3.1-1
  • Yubico Authenticator to generate OATH-HOTP and OATH-TOTP one-time password codes from secretes protected by the key

PIV

Check also Debian SSO (Single Sign-On) with a YubiKey.

OpenPGP

Various interesting HowTo, especially useful if you are new to OpenPGP subkeys:

Needed packages

To access the card you need GnuPG, the version in wheezy is fine for signing/encrypting.

However, if you want to use 4096-bits RSA keys, you need GnuPG 2.x, with the corresponding gpg-agent and scdaemon, at least the version in wheezy-backports, i.e. 2.0.25-1~bpo70+1.

OpenSSH authentication

This works out-of-the box on wheezy with GnuPG Agent and the corresponding scdaemon. You need to configure:

  • GnuPG to use the agent, in ~/.gnupg/gpg.conf

use-agent
  • GnuPG Agent to also act as an SSH agent, in ~/.gnupg/gpg-agent.conf:

enable-ssh-support

Once the agent started and the key plugged in, you can check if its authentication key has been added to the agent via the ssh-add -l command and then export the public key via the ssh-add -L command.

License

This document is licensed under the terms of the GNU General Public License (GPL), version 2 or (at your option) any later version.