You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Mac环境下使用YubiKey生成ed25519-sk密钥失败求助

在Mac上结合YubiKey生成ed25519-sk SSH密钥失败的问题

我在Mac系统中尝试用ssh-keygen工具结合YubiKey生成ed25519-sk SSH密钥,但操作失败,报错信息如下:

$ ssh-keygen -t ed25519-sk -f ed25519-sk -vvv
Generating public/private ed25519-sk key pair.
You may need to touch your authenticator to authorize key generation.
debug3: start_helper: started pid=62321
debug3: ssh_msg_send: type 5
debug3: ssh_msg_recv entering
debug1: start_helper: starting /usr/libexec/ssh-sk-helper
debug1: sshsk_enroll: provider "", device "(null)", application "ssh:", userid "(null)", flags 0x01, challenge len 0
debug1: sshsk_enroll: using random challenge
No FIDO SecurityKeyProvider specified
debug1: ssh-sk-helper: Enrollment failed: invalid format
debug1: main: reply len 8
debug3: ssh_msg_send: type 5
debug1: client_converse: helper returned error -4
debug3: reap_helper: pid=62321
Key enrollment failed: invalid format

已尝试的解决步骤(均无效)

  • 通过brew安装了libfido2(版本1.14.0),生成密钥时指定库路径,报错如下:
$ SSH_SK_PROVIDER=/usr/local/lib/libfido2.dylib ssh-keygen -t ed25519-sk -f ~/.ssh/ed25519-sk -vvv

Generating public/private ed25519-sk key pair.
You may need to touch your authenticator to authorize key generation.
debug3: start_helper: started pid=62422
debug3: ssh_msg_send: type 5
debug3: ssh_msg_recv entering
debug1: start_helper: starting /usr/libexec/ssh-sk-helper
debug1: sshsk_enroll: provider "/usr/local/lib/libfido2.dylib", device "(null)", application "ssh:", userid "(null)", flags 0x01, challenge len 0
debug1: sshsk_enroll: using random challenge
lib_contains_symbol: /usr/local/lib/libfido2.dylib does not contain expected string sk_api_version
provider /usr/local/lib/libfido2.dylib is not an OpenSSH FIDO library
debug1: ssh-sk-helper: Enrollment failed: invalid format
debug1: main: reply len 8
debug3: ssh_msg_send: type 5
debug1: client_converse: helper returned error -4
debug3: reap_helper: pid=62422
Key enrollment failed: invalid format
  • 为FIDO2设置PIN,但报错信息无变化。

补充信息

  • SSH版本:OpenSSH_9.7p1, OpenSSL 3.3.0 9 Apr 2024
  • YubiKey信息:
$ ykman info
Device type: YubiKey 5C NFC
Serial number: 23843986
Firmware version: 5.4.3
Form factor: Keychain (USB-C)
Enabled USB interfaces: OTP, FIDO, CCID
NFC transport is enabled

Applications    USB     NFC
Yubico OTP      Enabled Enabled
FIDO U2F        Enabled Enabled
FIDO2           Enabled Enabled
OATH            Enabled Enabled
PIV             Enabled Enabled
OpenPGP         Enabled Enabled
YubiHSM Auth    Enabled Enabled

请问我遗漏了什么配置或操作?

内容的提问来源于stack exchange,提问作者Vejt

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.24 11:17:23