A comprehensive community guide to securely using YubiKey hardware for GnuPG and SSH authentication to protect cryptographic secrets.
Community guide to using YubiKey for GnuPG and SSH - protect secrets with hardware crypto.
This guide is designed for users who want to enhance their identity and access management security by leveraging YubiKey hardware tokens for storing GnuPG and SSH keys securely. It is ideal for developers, security professionals, and privacy-conscious individuals seeking to protect encryption keys with hardware-backed non-exportable credentials and enable secure authentication workflows.
Users should generate cryptographic keys in a secure, dedicated environment to reduce risk of compromise. The guide emphasizes the non-exportable nature of keys on YubiKey, enhancing security but requiring careful backup strategies. Physical touch requirement is a recommended security feature to prevent unauthorized use. Compatibility excludes FIDO-only and Bio Series YubiKeys. Users should verify device authenticity to mitigate supply chain attacks.
Purchase a compatible YubiKey device (excluding FIDO-only Security Key Series and Bio Series)
Prepare a dedicated, secure environment for key generation
Install required software for GnuPG and YubiKey management (specific software not listed but implied)
Configure GnuPG with appropriate settings for YubiKey integration
Set up SSH and GnuPG agents as described in the guide
Change PIN
Modify the YubiKey PIN to secure access to cryptographic operations
Create Certify key
Generate a primary key used for certifying subkeys and identities
Create Subkeys
Generate encryption, signing, and authentication subkeys to be transferred to the YubiKey
Transfer Subkeys
Move subkeys securely onto the YubiKey hardware
Verify transfer
Confirm that keys have been correctly transferred and are operational on the YubiKey
Configure touch
Set YubiKey to require physical touch for cryptographic operations
SSH agent forwarding
Configure SSH agent forwarding using ssh-agent or gpg-agent for remote authentication
Reset YubiKey
Factory reset the YubiKey to remove all stored keys and configurations
Renew Subkeys
Update subkeys to extend their validity
Rotate Subkeys
Replace subkeys with new ones for enhanced security