Importing Yubikey's SSH/GPG key into a new computer

Importing the SSH key

# Mac Sequoia's `openssh` doesn't support FIDO2 resident keys.
brew install openssh

# Import the SSH key from Yubikey into the current path.
ssh-keygen -K

# Move the private key to the ssh default location for keys.
mv id_ecdsa_sk_rk ~/.ssh/id_ecdsa_sk

Importing the GPG key

# Create the stub for the secret key in your machine.
gpg --card-status

# Import the GPG key using the public file.
gpg --import key.pub

You may also like...

Amazon AWS