← retour aux snippets

ssh-keygen: clés FIDO2 (ed25519-sk)

Générer des clés SSH matérielles avec un token FIDO2/U2F (touch requis).

bash security #ssh#fido2#webauthn

objectif

Renforcer l’authentification SSH par possession d’une clé matérielle.

code minimal

ssh-keygen -t ed25519-sk -O resident -O verify-required -C "alice@data.pm"

utilisation

# ajouter à authorized_keys
cat ~/.ssh/id_ed25519_sk.pub | ssh alice@host 'mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys && chmod 600 ~/.ssh/authorized_keys'

variante(s) utile(s)

# lister les clés résidentes
ssh-keygen -K

notes

  • nécessite un token FIDO2 et un OpenSSH récent.
  • verify-required impose un touch/verification.