- GPG 无法签名数据
GPG 无法签名数据
如果当你在对 tag 或者 commit 签名时遇到以下提示:
error: gpg failed to sign the dataerror: unable to sign the tag
首先,物理插拔一下 Yubikey 并确保安全卡状态可以被正确的列出:
❯ gpg --card-status
如果你看到:
PIN retry counter : 0 0 3
这意味着你的正常 PIN 码因为输错次数太多而被锁定。第三个数字表示的是管理员 PIN 码的重试计数器。
通过输入管理员 PIN 码来解锁正常 PIN 码:
❯ gpg --card-editgpg/card> adminAdmin commands are allowedgpg/card> passwdgpg: OpenPGP card no. … detected1 - change PIN2 - unblock PIN3 - change Admin PIN4 - set the Reset CodeQ - quitYour selection? 2PIN unblocked and new PIN set.1 - change PIN2 - unblock PIN3 - change Admin PIN4 - set the Reset CodeQ - quitYour selection? q
