OpenSSH FIDO2 Resident Keys Need Presence, Verification, and Token Recovery Policy

OpenSSH supports hardware-backed FIDO authenticator keys, including resident credentials that can be recovered on another machine. The hardware removes a static private-key file from the workstation, but the authentication policy does not end at the token. It also depends on touch requirements, PIN or user verification, server-side options, token loss procedures, and the way resident credentials are recovered.

Know what resident actually changes

The ssh-keygen manual describes -O resident as storing the key handle on the FIDO authenticator. A resident credential can be loaded from the token with ssh-add, and OpenSSH can regenerate handle files on another machine. This is useful for portability and can reduce manual key-file transfers.

It also changes the recovery model. The manual warns that storing both parts of a key on a FIDO authenticator increases the likelihood that an attacker can use a stolen token. A stolen token is not automatically sufficient, because a PIN or user verification may still be required. The organization must decide what additional factor and revocation path protect the credential.

Nonresident FIDO keys still require the authenticator when signatures are made, but the local key handle remains part of the workstation state. Record the key type, whether the credential is resident, and where any handle files are stored.

Make presence and verification explicit

OpenSSH supports no-touch-required and verify-required key options. The current sshd_config manual describes PubkeyAuthOptions with touch-required and verify-required. touch-required forces FIDO signatures to attest that a physically present user confirmed authentication. verify-required requires the signature to attest user verification, such as a PIN.

The server-side default is not a substitute for organization policy. Public key queries can test whether a key is accepted without a full authentication attempt, and OpenSSH defines a max-pk-ok limit for those queries. Review how the server handles them and whether repeated query attempts are logged or rate-limited.

If a workflow needs unattended access, do not quietly copy a resident credential to every host. Use a separate service identity and a control appropriate to that workload. A hardware token requirement that becomes a shared token in a drawer is no longer a strong user-presence control.

Plan enrollment and recovery

Generate keys with the intended resident, user, verification, and attestation settings. Attestation data may be sensitive, so define whether it is retained and who can access it. Bind resident credentials to a meaningful user name when multiple credentials are enrolled for the same application.

Test recovery on a clean machine. Confirm that ssh-keygen -K or the organization's approved process retrieves the expected handle, that the server accepts only the intended public key, and that the user can complete the required presence or verification step.

Prepare for token loss before it happens. Record the key fingerprint and inventory the accounts where it is authorized. A revocation list can remove a key, but the response also needs a new token, a replacement key, account verification, and a review of recent sessions.

Test the policy from both ends

Test the client and server together. Confirm that a key generated without touch or verification is rejected by the server policy. Confirm that a resident credential from the wrong FIDO application or user is not accepted. Check that authorized_keys options cannot weaken the intended global policy unless explicitly approved.

Log authentication method, key fingerprint, user, source, and policy result without logging the PIN or sensitive attestation data. Alert on a key used from an unexpected network and on repeated public-key queries.

The defensible outcome is a token inventory and an authentication policy that agree. A FIDO badge on the key is not enough. The reviewer should know whether the credential is resident, what the signature must prove, who can recover it, and how it is removed after loss.

References