How to Set Up a Security Key for Your Accounts in 2026
How to set up a security key for your accounts is simpler than most guides make it sound. Buy two FIDO2 security keys, set a PIN on each, add both keys to your email account, and save the recovery codes offline. From then on, a stolen password is not enough to get into your accounts.
A security key is a small hardware device, like a YubiKey, that proves it is really you signing in. It uses the FIDO2 and WebAuthn standards, which resist phishing in a way that codes and passwords cannot. Even if an attacker steals your password, they cannot sign in without your physical key.
This guide covers choosing a key, setting a PIN, adding keys to Gmail, Outlook, Apple and your password manager, using the key for SSH, and what to do if you lose one. It gives you a cross-service setup order, which most guides skip.
Key Takeaways
Buy two FIDO2 keys: a primary and a backup, registered on every account before you rely on either one.
Set a FIDO2 PIN on each key once, and use a PIN of six or more characters that you will remember.
Start with email and your password manager, because those accounts control recovery for everything else.
Save recovery codes offline, somewhere separate from both keys, before you remove weaker login methods.
Passkeys stored on a key are device-bound and cannot be copied, so register the backup key separately.
What a Security Key Is and Why It Beats Codes
A security key is a hardware device that holds cryptographic credentials and signs a challenge from the website you are signing in to. The website sends a challenge, the key signs it, and the signature proves the key is present.
The private key never leaves the device, so it cannot be phished or copied from a server breach.
Authenticator apps and SMS codes are weaker. An SMS code can be intercepted, and a code from an app can be phished if you type it into a fake site.
A security key checks the website’s identity before it signs, so a fake site gets nothing. That phishing resistance is the main reason security keys are the strongest login method available.
Choosing a Key: Models, Connectors and Firmware
For most people, the YubiKey 5C NFC is the best all-rounder. It has USB-C for modern laptops and phones, plus NFC for tapping against a phone. The YubiKey 5 NFC is the USB-A version for older desktops. Both support FIDO2, passkeys, authenticator codes and smart card features.
The cheaper Security Key series supports FIDO2 and WebAuthn only, with USB-A or USB-C plus NFC. Choose it when all your accounts support FIDO2 and you do not need authenticator codes or smart card features. It is the budget option, and it covers the core job just as well.
Check the firmware before you buy. Keys with Yubico’s 5.7 firmware, sold since mid 2024, hold up to 100 passkeys, and firmware 5.8 became generally available in July 2026.
Step 1: Set a PIN on Your Keys
A PIN stops someone who finds your key from using it as a passkey. You only need to set it once per key, not once per account.
Plug the key in, open the free Yubico Authenticator app, and choose to set a PIN. It can be letters as well as numbers, at least four characters, though six or more is better.
Do the same on your spare key, and using the same PIN on both is fine and easier to remember. Save the PIN in your password manager, because forgetting it is a real problem. Yubico documents eight PIN attempts, with reinsertion required after three consecutive incorrect attempts, and exhausting them blocks the FIDO2 application.
A forgotten PIN requires a FIDO2 reset, which deletes the passkeys on that key. You must then register the key again with each service. That is why the backup key matters so much: if one key is reset, the other still works while you re-register the first.
Step 2: Add Your Keys to Gmail and Outlook
Start with email, because it controls password resets for almost everything else. In Gmail, go to your Google account security settings, find passkeys and security keys, and add your first key.
When your browser offers to save the passkey on the computer or phone, choose the security key option, insert it, type its PIN and touch it when it flashes.
Then add your second key straight away, using the same flow a second time. Save the recovery codes somewhere offline before you finish, and test the login in a private browser window to confirm the key is really being used.
For Outlook, go to your Microsoft account security settings, choose advanced security options, and add a security key. The flow is the same: insert the key, enter the PIN, touch it when prompted, and name it clearly. Repeat with the backup key, and save the recovery codes offline.
Step 3: Password Manager, Apple ID and Other Accounts
Once email is protected, add both keys to your password manager. In 1Password or Bitwarden, open account settings, find two-factor authentication, choose security key, and register both keys. Your password manager holds the keys to everything else, so it deserves the same protection as your email.
For your Apple account, go to Settings, tap your name, then Sign-In and Security, then Two-Factor Authentication, and choose Add Security Keys. Apple requires at least two hardware keys, which is another reason to buy a pair. Register both, and keep the recovery key Apple gives you in a safe place.
Then repeat the same flow for your other high-value accounts: GitHub, social accounts, crypto exchanges, cloud services and your bank where supported. Register both keys on each one, name each key clearly in the account, and save the recovery codes. Only then remove weaker recovery methods, if the service and your situation allow it.
Using a Security Key for SSH
Security keys also protect SSH logins, which matters if you manage servers. OpenSSH 8.2, released in February 2020, added native FIDO2 support, so no extra software is needed on Linux or macOS. First set a PIN on the key, because SSH resident keys require one, using the YubiKey Manager tool.
Generate the key with the command ssh-keygen -t ed25519-sk, adding the resident and verify-required options if you want the key material stored on the hardware and a PIN check on every use. This produces a standard key pair, but the private key is a stub: the actual signing happens on the hardware.
Copy the public key to the server’s authorised keys file, or paste it into GitHub’s SSH keys page, exactly as you would a normal key.
Test the new key in a second terminal window before closing the session you are already logged into. Never configure SSH to require only your hardware key until the backup key is registered and tested.
What to Do If You Lose Your Key
Losing a key is stressful, but it is not a disaster if you prepared. Sign in with your backup key, remove the lost key from each account, and register a replacement. The lost key alone cannot get an attacker in, because they would also need your password and, for passkeys, your PIN.
If you lose your only key and have no backup, use the recovery codes you saved offline.
That is why saving them matters more than any other step in this guide. If you have neither a backup key nor recovery codes, you will need the account recovery process, which can take days and may require identity documents.
Security Keys, Passkeys and Authenticator Apps Compared
The table below separates the three login methods that most guides mix up, so you can choose the right one for each account.
Method
Phishing Resistant
Needs Hardware
Best For
Security key (FIDO2)
Yes, strongest
Yes, a physical key
Email, password manager, high-value accounts
Passkey on phone
Yes
No, uses phone biometrics
Everyday logins, convenience
Passkey on security key
Yes, strongest
Yes, a physical key
Maximum security, device-bound
Authenticator app (TOTP)
No, codes can be phished
No, phone app
Accounts without FIDO2 support
SMS code
No, weakest
No
Last resort only
Password only
No
No
Nothing important
Checklist: Set Up Your Security Keys in One Sitting
Use this checklist to complete the whole setup in one sitting, in the order that prevents lockouts.
Buy two FIDO2 keys from a trusted seller, and check the firmware is current.
Set a PIN on both keys using the Yubico Authenticator app, and save the PIN in your password manager.
Add both keys to your email account first, then your password manager, and save the recovery codes offline.
Add both keys to your Apple account, GitHub, social accounts and other high-value services.
Test the primary and backup keys in a private browser window, and confirm the key is really being used.
Set up SSH with your keys if you manage servers, and test in a second terminal window first.
Store the backup key separately from the primary, and only then remove weaker login methods.
Frequently Asked Questions
How do I set up a security key for my accounts?
Buy two FIDO2 keys, set a PIN on each with the Yubico Authenticator app, and add both keys to your email account first. Then add them to your password manager, Apple account and other high-value services. Save the recovery codes offline, test both keys, and only then remove weaker login methods.
What is the difference between a security key and a passkey?
A security key is the hardware device, while a passkey is a credential that can live on the key, on your phone, or in your password manager. A passkey stored on a security key is device-bound and cannot be copied to another key. A passkey on your phone uses biometrics and syncs across your devices.
Do I really need two security keys?
Yes. A single key with no backup turns a lost key into a lockout, and passkeys on a key cannot be copied to a replacement. Register the backup key on every account before you rely on either one. Apple requires two keys for Apple ID security keys, and the same logic applies everywhere else.
What happens if I forget my FIDO2 PIN?
Stop guessing and check that you can sign in with your backup key first. Yubico documents eight PIN attempts, with reinsertion required after three consecutive incorrect attempts. Exhausting the attempts blocks the FIDO2 application, and a forgotten PIN requires a reset that deletes the key’s passkeys.
Can I use a security key with my phone?
Yes. Keys with NFC work by tapping them against the back of your phone, and USB-C keys plug directly into modern phones. The setup flow is the same as on a computer: open the account’s security settings, add the key, enter the PIN and touch the key when prompted.
Are security keys better than authenticator apps?
Yes, for phishing resistance. A security key checks the website’s identity before it signs, so a fake site gets nothing. An authenticator app generates codes that can be phished if you type them into a fake site. Authenticator apps are still useful for accounts that do not support security keys yet.
Conclusion
Setting up a security key is one of the highest-value security steps you can take. Two keys, a PIN, and recovery codes saved offline protect your email, your password manager and every account behind them. The setup takes under an hour, and the protection lasts for years.
Start with email and your password manager today, add the rest of your accounts this week, and test your backup key before you need it.
Ayesha is the co-founder of occcy and the editor behind its entertainment and lifestyle coverage. She believes good writing should feel like a conversation with a smart friend, clear, warm, and genuinely helpful.