
This works the same as before, except a resident key is easier to import to a new computer because it can be loaded directly from the security key. If your security key supports FIDO2 resident keys*, like the YubiKey 5 Series, YubiKey 5 FIPS Series, or the Security Key NFC by Yubico, you can enable this when creating your SSH key: Or, if your security key supports it, you can use a FIDO2 resident key. You’ll need to copy the id_ecdsa_sk file to each computer where you want to use this SSH key. The second is id_ecdsa_sk which would usually contain the corresponding private key, but in this case it instead contains a “ key handle” that references the security key. The first is id_ecdsa_sk.pub, which is a normal OpenSSH public key file whose contents you’ll need to paste into the new SSH key form on GitHub.

This will create two files in your SSH directory. You can also use -t ed25519-sk to create an EdDSA key instead, but this is not supported by all security keys. The option -t ecdsa-sk instructs OpenSSH to create an ECDSA key on a FIDO security key instead of a traditional private key file. Plug in your security key and run the command:
#OPENSSH GITHUB WINDOWS#
Windows users may need to use Cygwin for this.įirst you’ll need to generate a key pair. To get started you’ll need OpenSSH version 8.2 or later, and you’ll also need libfido2 installed. While it has long been possible to use the YubiKey for SSH via the OpenPGP or PIV features, the direct support in SSH is easier to set up, more portable, and works with any U2F or FIDO2 security key – even older ones like the FIDO U2F Security Key by Yubico. This makes it easier than ever to use YubiKeys to secure all your GitHub access, making your SSH keys much more secure while maintaining a great user experience.

Today, GitHub has announced support for using U2F and FIDO2 security keys for SSH, and we’re honored to have been an early collaborator in working with GitHub on developing this feature.
