Security / Guide

Two-factor authentication, passkeys and FIDO2 keys (YubiKey and others)

Two-factor authentication methods ranked from weakest to strongest (SMS, codes, notifications, passkeys, FIDO2 keys), why only some resist modern phishing, how to choose and set up a security key, and how to deploy it all at home, in Entra ID, on Windows and for SSH on Linux.

Security Guide Intermediate Published October 20, 2026 Translated November 20, 2026 18 min read Version française
A USB security key on a dark surface
Photo: Andy Kennedy on Unsplash

In plain words

A password is a key that can be copied: if someone sees it or steals it, they get in. Two-factor authentication adds a second element the thief doesn't have: your phone, your fingerprint, or a small USB security key. But not all two-factor authentication is equal: a code received by SMS can be typed into a fake site by a scammer, whereas a FIDO2 key or a passkey checks for itself that it's talking to the real site and refuses to answer the fake one. It's the difference between a guard who asks for a code and a guard who recognises your face.

1. Authentication factors

Factor What it is Examples
Something I know A memorised secret Password, PIN
Something I have An object Phone, security key, smart card
Something I am A physical characteristic Fingerprint, face

Two-factor authentication (2FA) or multi-factor authentication (MFA) combines at least two different factors. Two passwords don't make two-factor authentication.

2. The methods, from weakest to strongest

Method How it works Resists modern phishing? Main risks
SMS or voice call A code sent to the phone No SIM swapping (the attacker takes over your number), interception, code typed into a fake site
Email code A code sent to the mailbox No If the mailbox is compromised, everything is
TOTP code (authenticator app) A 6-digit code that changes every 30 seconds No Code typed into a fake site; phone lost with no backup
Approval notification An "Approve" button on the phone No MFA fatigue: the attacker sends dozens of requests until the exasperated user accepts
Notification with number matching Typing on the phone the number shown on the login screen No, but limits MFA fatigue Still vulnerable to a fake relay site
Synced passkey A cryptographic key in the password manager (Apple, Google, Bitwarden, 1Password…), unlocked by biometrics or PIN Yes Depends on the security of the account that syncs it
Device-bound passkey and FIDO2 security key The private key never leaves the phone or the physical key Yes Losing the key: plan a second key
Windows Hello for Business, smart card or certificate Key bound to the PC's hardware (TPM chip) or to a card Yes Heavier to deploy

Why codes are no longer enough

Today's phishing kits (called AiTM, adversary-in-the-middle) put a fake relay site between the victim and the real site. The victim enters their password and code on the copy; the relay passes them instantly to the real site, and steals the session token that comes back. The attacker is logged in, two-factor authentication included.

A passkey or a FIDO2 key defeats this attack: the key is bound to the domain name of the site it was created on. On micr0soft-login.com, it simply doesn't exist, and nothing can be relayed.

The order of priority

Weak two-factor authentication is infinitely better than none: it blocks the vast majority of automated attacks using stolen passwords. Turn it on everywhere, then gradually replace SMS with an app, and the app with passkeys or FIDO2 keys, starting with the most important accounts.

3. Passkeys and FIDO2: the vocabulary

Term Meaning
FIDO2 The FIDO Alliance's standard for passwordless authentication, made up of WebAuthn (browser and site side) and CTAP (talking to the key)
Passkey The consumer name for a FIDO2 credential: a key pair, the private key stays with you, the public key is given to the site
Synced passkey Stored encrypted in a manager (iCloud Keychain, Google Password Manager, Bitwarden…) and available on all your devices
Device-bound passkey Never leaves the device: security key, the phone's secure chip (for example in Microsoft Authenticator)
Discoverable credential (resident key) A passkey stored in the security key: it lets you log in without even entering your username. Keys have a limited number of slots
U2F FIDO2's predecessor: the key acts as a second factor after the password
Attestation Proof, supplied by the key, of its model and manufacturer; businesses can allow only certain models

4. Choosing a security key

Manufacturer Country Features
Yubico (YubiKey) Sweden The reference. YubiKey 5 range: FIDO2, U2F, smart card (PIV), OpenPGP, TOTP and HOTP codes; Security Key range limited to FIDO2 and U2F. FIPS-certified versions
Token2 Switzerland Many FIDO2 models, some with a very large number of passkey slots; models with a fingerprint reader
Nitrokey Germany Open source, auditable firmware; FIDO2, OpenPGP, TOTP depending on the model
Feitian China Wide range, including biometric models; very common with integrators
Google Titan United States FIDO2 and U2F, simple, well integrated with the Google ecosystem

The criteria

Criterion What to look at
Connector USB-A, USB-C, and NFC to use it with a phone; "nano" format to leave it permanently in a laptop
Number of passkeys YubiKeys with firmware 5.7 and later store up to 100 passkeys; earlier versions, 25
Features beyond FIDO2 PIV smart card (Windows, VPN), OpenPGP (signing, SSH), TOTP codes stored in the key
Certification FIPS 140 or national certifications (such as CSPN in France) for some regulated environments
Biometrics Built-in fingerprint reader: handy if you don't want a PIN

A YubiKey's firmware can't be updated

For security reasons, a YubiKey's firmware is fixed at manufacture. A key bought with an old version keeps its limits (number of passkeys, features). Check the version advertised before buying.

Always two keys

Buy two keys (or a key and a passkey on your phone), register both on every account, and keep the second one somewhere safe. Also keep the recovery codes for important services, printed or in your password manager. A lost key with no backup means a lost account.

Setting up a key

  1. Install Yubico Authenticator (Windows, macOS, Linux, mobile) or your manufacturer's tool.
  2. Set a FIDO2 PIN (at least 6 characters, not 123456): it's asked for at every use and the key locks after 8 failed attempts.
  3. On each service, go to the security settings and choose Add a security key or Create a passkey.

On the command line with the ykman tool (YubiKey):

ykman info
ykman fido access change-pin
ykman fido credentials list

5. At home: where to start

  1. Email: it's what lets you reset every other password.
  2. The password manager (see the dedicated guide).
  3. The Apple, Google or Microsoft accounts, which give access to backups and devices.
  4. The bank, tax and public services (with the methods they require).
  5. Social networks, cloud storage, online shops.

For TOTP codes, prefer an app that backs up its codes encrypted (Ente Auth, Aegis on Android, your password manager's app): a lost phone mustn't lock you out.

6. In a business with Microsoft Entra ID

Microsoft is retiring SMS and voice calls

In Entra ID, since 1 September 2026, passkeys have become the default method and are enabled automatically for users who were using SMS or voice calls. On 1 February 2027, SMS and voice calls provided by Microsoft will be retired for all users, except Global Administrators and external users (retired on 1 July 2027). After that date, a user whose only method is SMS will have to create a passkey to sign in. Organisations that want to keep SMS will need a third-party telephony provider.

The approach

  1. Inventory of the methods in use: the Authentication methods > Activity report in the Entra admin center, or the script provided by Microsoft to find SMS users.
  2. Authentication methods policy (Protection > Authentication methods): enable Passkey (FIDO2), Microsoft Authenticator (with number matching, now enforced), Windows Hello for Business; gradually disable SMS, voice call and email.
  3. Registration campaign: ask users to register a passkey when they sign in.
  4. Administrators first: FIDO2 keys or passkeys in Microsoft Authenticator, required by Conditional Access with the phishing-resistant authentication strength (see conditional access and access governance).
  5. Account recovery: define how a user who has lost their key gets access back (a Temporary Access Pass, issued after identity verification).
Population Method recommended by Microsoft
Administrators, privileged users, regulated sectors FIDO2 security keys, or passkeys in Microsoft Authenticator
Users on company Windows PCs Windows Hello for Business
Other users Synced passkeys or passkeys in Microsoft Authenticator

Windows Hello for Business

It turns the PC into a security key: the private key is stored in the TPM chip and unlocked by a local PIN or biometrics. The PIN never leaves the device: stolen, it's useless without the PC. For access to on-premises AD resources, the cloud Kerberos trust model is now the simplest to deploy.

7. On Linux: SSH and sudo with a FIDO2 key

Since OpenSSH 8.2, a FIDO2 key can hold an SSH key whose private part never leaves the physical key:

ssh-keygen -t ed25519-sk -O resident -O verify-required -C "spo-yubikey"
Option Effect
-t ed25519-sk SSH key backed by the security key (-sk: security key)
-O resident The key is stored in the security key, retrievable on another PC with ssh-keygen -K
-O verify-required Requires the PIN in addition to a touch

Then copy the public key to the server (ssh-copy-id), like a regular key (see securing SSH). Every connection will ask you to touch the key: malware on your computer can't use it behind your back.

To require the key for sudo or for local login, the pam_u2f PAM module (package libpam-u2f on Debian and Ubuntu) is added to the files in /etc/pam.d/. Test it with a second terminal left open as root: a mistake in PAM can lock you out of every login.

8. Good practice

Practice Why
Two-factor authentication everywhere, starting with email and administrators Blocks most attacks using stolen passwords
Phishing-resistant methods for administrators They're the ones sophisticated attacks target
Two keys per person for critical accounts, and recovery codes kept No account lost along with a key
Gradually disable SMS, voice call and email The weakest methods
Number matching for notifications Against MFA fatigue
Recovery procedure with identity verification A scammer calling the helpdesk to "reset their two-factor authentication" is a classic attack
Never approve a request you didn't start, and report it It's the sign the attacker already knows the password

Key points

  • Any two-factor authentication is better than none, but SMS, codes and notifications can be bypassed by fake relay sites.
  • Passkeys and FIDO2 keys are bound to the real site: they resist phishing.
  • Choose a security key by connector (USB-C, NFC), number of passkeys and the features you need; get two.
  • Entra ID has used passkeys by default since September 2026 and retires SMS in February 2027.
  • On Linux, ssh-keygen -t ed25519-sk puts your SSH key inside the security key.

Read next